rest2web-develop Mailing List for rest2web (Page 15)
Brought to you by:
mjfoord
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(74) |
Aug
(71) |
Sep
(6) |
Oct
(6) |
Nov
(3) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(8) |
Feb
(17) |
Mar
(16) |
Apr
(48) |
May
(9) |
Jun
|
Jul
(7) |
Aug
(93) |
Sep
(18) |
Oct
(17) |
Nov
(22) |
Dec
(11) |
2007 |
Jan
(11) |
Feb
|
Mar
(61) |
Apr
(14) |
May
(3) |
Jun
|
Jul
(13) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(6) |
2008 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(2) |
Nov
(7) |
Dec
(7) |
2009 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2010 |
Jan
(1) |
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
2011 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(14) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2016 |
Jan
(2) |
Feb
(5) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Marcelo G H. <mar...@gm...> - 2006-08-05 19:31:37
|
El 05/08/2006 a las 16:04, martin f krafft <ma...@ma...> dijo, en su mensaje "[Rest2web-develop] rst conversion options": > It seems there is no way to pass additional values to > restutils.html_parts(...) or is there? Putting the desired values in docutils.conf should do the trick, I think. See http://docutils.sourceforge.net/docs/user/config.html#configuration-files for more information. -- o-=< Marcelo >=-o |
From: martin f k. <ma...@ma...> - 2006-08-05 19:31:28
|
also sprach martin f krafft <ma...@ma...> [2006.08.05.1917 +0100]: > - how can I get the page object (indextree node) of the page > currently being rendered? Do I really have to do a recursive > search through the tree until thispage is true? Ah, there is 'thispage', which you can use just like 'indextree'. Sorry, didn't spot that earlier. > - I saw the target value, which is the URL of any page relative to > the one currently being rendered. I wonder whether it is > possible to get the URL of the currently rendered page relative > to the root as well? So page_url:target:base_url triplets would > be (for foo/index.txt) This is still an issue though. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "those are my principles, and if you don't like them... well, I have others." -- groucho marx |
From: martin f k. <ma...@ma...> - 2006-08-05 19:04:11
|
I've been using RST for several years before coming to rest2web. I've gotten into the habit of always using the --initial-header-level=3D2 --cloak-email-addresses --rfc-references --pep-references --strip-comments --no-toc-backlinks flags to rst2html. I noticed that I can set restindex['initialheaderlevel'] and that cloaking for email addresses is on by default, but how would I go about setting the others? It seems there is no way to pass additional values to restutils.html_parts(...) or is there? Cheers --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "i wish i hadn't slept all day, it's really lowered my productivity" -- robert mcqueen |
From: martin f k. <ma...@ma...> - 2006-08-05 18:16:58
|
I am getting closer to my goal. Two remaining questions now are - how can I get the page object (indextree node) of the page currently being rendered? Do I really have to do a recursive search through the tree until thispage is true? - I saw the target value, which is the URL of any page relative to the one currently being rendered. I wonder whether it is possible to get the URL of the currently rendered page relative to the root as well? So page_url:target:base_url triplets would be (for foo/index.txt) /index.html:../index.html /bar.html:../bar.html /foo/index.html:index.html /foo/bar.html:bar.html Thanks, --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 linux: because a pc is a terrible thing to waste |
From: Michael F. <fuz...@vo...> - 2006-08-05 17:27:54
|
Hello all, This is to let you know, that barring last minute bug reports or doc corrections, I've just done the final commit before releasing 0.5.0beta1. This contains quite a few changes since 0.5.0alpha1, largely thanks to Martin Krafft. The changes since the last public release 0.4.0 are quite substantial. The total changelog is (I will try to summarise it for the release announcement) : Version 0.5.0 beta 1 2006/08/05 ------------------------------- Updated docs. Moved 'pythonutils' distribution into the 'rest2web' directory for ease of packaging. Added a ``#!`` line to ``r2w.py``. All rest2web imports now absolute imports. Added 'quickstart.txt' thanks to Andrew Ittner. Added an ``include`` standard function, this can be used to nest templates or customise sections. (It will walk up the directory tree looking for the file you specify and takes an optional argument if the file doesn't exist - useful for templates that allow subdirectories to add to the template, or even wrap the body.) ``make_dist.py`` now takes ``nopause`` as a command line argument (``make_dist.py`` is in `Subversion`_ for creating distributions.) Default breadcrumb divider is now '>'. Breadcrumbs are also output in HTML on separate lines for readability. Fixed bug when ``final_encoding`` is ``None``. Default config file is now called ``r2w.ini``. ``rest2web.ini`` will still be supported until the next release. Fixed bug with ``standerr`` where no logfile is used. ``print_crumbs`` can now take ``None`` for the dividers. Added 'globalValues' to the namespace. Experimentally added 'uservalues' and 'restindex' into each page in the indextree. Encoding is not handled so they will be in the source encoding. Special thanks to Martin Krafft for bugfixes and suggestions. Version 0.5.0 alpha 2006/05/01 ------------------------------ **rest2web** can now build a site with no index pages, no template and no restindexes. This is the `force <../force_mode.html>`_ command line option. It can be used to automatically build a site from a collection of ReST documents, and use default templates. ``uservalues`` can be passed at the `command line <../command_line.html>`_ and in the config file. (Command line `uservalues <uservalues.html>`_ override config file ones.) These uservalues are now available in every page. The encoding of uservalues in the config file is specified by the ``__encoding__`` value. A ``--template-file`` (or ``-t``) command line option. (Will override the top level ``template`` keyword specified in the restindex.) This allows you to have alternative templates for a site; for example one for an online version and another for distributed documentation. New website template, created by `Fuchsiashock Design <http://www.fuchsiashock.co.uk>`_. ``final_encoding`` should never be ``utf8`` - should be ``utf-8`` instead. This is because ``utf8`` is not recognised by browsers. (This is now automatically handled.) Added ``initialheaderlevel`` a new restindex keyword. It sets the size of headers used in ReST documents. Can be set per page. The ``file`` keyword has been bugfixed. It now only operates if the target file doesn't exist or is different to the source file. It copies the timestamp along with the file. The `gallery plugin <gallery.html>`_ now ignores non-image files. It also skips image files it can't handle (currently only animated jpgs. **rest2web** now has three levels of verbosity, controlled from the command line : * ``-v`` : Verbose, the default. * ``-a`` : Warnings and actions. * ``-w`` : Warnings only. ``uservalues`` can now be inserted in pages using a new syntax. Where this is used, the uservalues are inserted *before* the page is rendered from ReST to HTML. This means uservalues can be in ReST format. The syntax for single values is ``{lt}* ... *>``. For multiple lines of code it is ``{lt}$ ... $>``. Added ``modtimeiso`` value to the namespace and the ``formattime`` `standard function <../functions.html>`_. The ``namespace`` and ``uservalues`` are both now available (as dictionaries) to the macros and the standard functions. Removed the two ``<br />`` from ``listend`` in the standard function ``minibar`` and added ``wrapper_class`` to ``print_details``. Added ``os`` and ``sys`` to the namespace for every page. The default crumb for index pages (if no ``page-title`` specified) is the filename, minus the extension and turned to title case. Removed ``urlpath`` from rest2web, because it is now in pythonutils. It won't run in the distribution directory - need to run "make_dist.py". (This only applies if fetched from `subversion <http://svn.rest2web.python-hosting.com>`_. |
From: Michael F. <fuz...@vo...> - 2006-08-05 16:16:41
|
martin f krafft wrote: > Currently, {defn;something;a > definition} (note the embedded newline) does not work, the macro > will not be interpreted. Any chance of ignoring newlines? The best option is to get your macro to use the '+/-' syntax I suggested in the other email. See the coloring macro for an example. Alternatively, changing the regular expression in 'textmacros.py' to multiline should work : re_macro = re.compile("(\{[+-]?\w+.*?})", re.M) But I would prefer the first choice as I worry that macro matching may become brittle if it searches multiple lines for matches. Michael > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: martin f k. <ma...@ma...> - 2006-08-05 16:10:03
|
Currently, {defn;something;a definition} (note the embedded newline) does not work, the macro will not be interpreted. Any chance of ignoring newlines? --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank god for the better sleep he enjoys after this process of grotesque self-deception."=20 -- mark twain |
From: Michael F. <fuz...@vo...> - 2006-08-05 15:45:54
|
martin f krafft wrote: > also sprach Michael Foord <fuz...@vo...> [2006.08.05.1609 +0100]: > >> Don't forget that rest2web is built top down. The indextree only >> contains information for pages/directories above the one currently being >> rendered, not for the whole site. >> > > Well, uh, doesn't it contain the pages list which I could recurse to > the leafs? > > In any case, I think it's okay to be top-down. I can't think of > a use when a page needs to know about its children other than that > they exist (for purpose of a table of contents or sidebar). > > If i ever get the time (and this release has taken longer than expected ;-), rest2web will be done in 'two passes'. It will cache generated pages and so be able to skip rebuilding pages that haven't changed. The whole site will be available to all pages. This will enable the auto-generation of contents pages/sitemaps etc... None of this is technically very difficult. Given my other priorities it may be many months before I can return to it though. :-( Fuzzyman http://ww.voidspace.org.uk/python/index.shtml >> I've now (experimentally) added the restindex and uservalues for each >> page into the indextree. Now checked in. >> >> Please let me know if this works for you. >> > > Looks exactly like what I had in mind! > > Thanks! > > |
From: Michael F. <fuz...@vo...> - 2006-08-05 15:38:38
|
martin f krafft wrote: > also sprach Michael Foord <fuz...@vo...> [2006.08.05.1609 +0100]: > >> Don't forget that rest2web is built top down. The indextree only >> contains information for pages/directories above the one currently being >> rendered, not for the whole site. >> > > Well, uh, doesn't it contain the pages list which I could recurse to > the leafs? > indextree is built specially. All encodings are turned into the encoding of the page being rendered and all links are made relative to the current page. It currently just goes up the tree - not into all the leafs (leaves ?). To do so would slow down site generation. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > In any case, I think it's okay to be top-down. I can't think of > a use when a page needs to know about its children other than that > they exist (for purpose of a table of contents or sidebar). > > >> I've now (experimentally) added the restindex and uservalues for each >> page into the indextree. Now checked in. >> >> Please let me know if this works for you. >> > > Looks exactly like what I had in mind! > > Thanks! > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: Michael F. <fuz...@vo...> - 2006-08-05 15:34:41
|
martin f krafft wrote: > Check out http://martin-krafft.net/phd/ and hover over one of the > terms with a dotted underline. This is very nice. :-) > This is a simple CSS trick actually, > but I use a macro to make it happen: > > {defn;method;Method;a definition} > > This will turn into "method", which is a <span> that if hovered over > will produce a popup defining "Method" with "a definition". CSS > then makes it work. > > Now what I'd really like is to be able to use popups within popups, > like the definition of "Method" in the first paragraph of the above > page. > > So I tried: > > {defn;method;Method;use of {defn;tools;Tool;a definition}} > > but rest2web does not seem to support this at all. > > Any chance this could be implemented? > > Macros are the work of Hans Nowak and implemented in 'textmacros.py'. Nested inline macros are *not* possible, but there is another syntax that I think may work. I'm not sure if you can pass arguments this way : {+macrostart} some text {+macrostart} nested text {-macrostart}{-macrostart} See the 'coloring' macro for an example. All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: martin f k. <ma...@ma...> - 2006-08-05 15:33:08
|
also sprach Michael Foord <fuz...@vo...> [2006.08.05.1609 +010= 0]: > Don't forget that rest2web is built top down. The indextree only=20 > contains information for pages/directories above the one currently being= =20 > rendered, not for the whole site. Well, uh, doesn't it contain the pages list which I could recurse to the leafs? In any case, I think it's okay to be top-down. I can't think of a use when a page needs to know about its children other than that they exist (for purpose of a table of contents or sidebar). > I've now (experimentally) added the restindex and uservalues for each=20 > page into the indextree. Now checked in. >=20 > Please let me know if this works for you. Looks exactly like what I had in mind! Thanks! --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 remember, half the people you know are below average. |
From: martin f k. <ma...@ma...> - 2006-08-05 15:26:02
|
Check out http://martin-krafft.net/phd/ and hover over one of the terms with a dotted underline. This is a simple CSS trick actually, but I use a macro to make it happen: {defn;method;Method;a definition} This will turn into "method", which is a <span> that if hovered over will produce a popup defining "Method" with "a definition". CSS then makes it work. Now what I'd really like is to be able to use popups within popups, like the definition of "Method" in the first paragraph of the above page. So I tried: {defn;method;Method;use of {defn;tools;Tool;a definition}} but rest2web does not seem to support this at all. Any chance this could be implemented? --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "emacs sucks, literally, not an insult, just a comment that it's large enough to have a noticeable gravitational pull..." -- mercury on #debian-devel |
From: Michael F. <fuz...@vo...> - 2006-08-05 15:21:46
|
Michael Foord wrote: > martin f krafft wrote: > >> also sprach Michael Foord <mi...@pc...> [2006.08.05.1426 +0100]: >> >> >>> Which is perhaps a little ugly. :-) >>> >>> The better way of achieving this is to provide uservalues in your site >>> config file. These are already available to every page. >>> >>> >> by site config file, you mean .ini file? >> >> >> > Yes. > > >>> You can't access the restindex or uservalues of pages through >>> indextree. >>> >>> >> Mh, this is not what I wanted to hear... would it be possible to add >> this? I think it would just make it a whole lot more flexible, >> especially since indextree seems to be the structure representing >> the entire site and hence needs to be used for a lot of different >> functions. >> >> > > Don't forget that rest2web is built top down. The indextree only > contains information for pages/directories above the one currently being > rendered, not for the whole site. > > I've now (experimentally) added the restindex and uservalues for each > page into the indextree. Now checked in. > As this is experimental, encoding is not handled for this value. I think they are still in the source encoding. Michael > Please let me know if this works for you. > > Fuzzyman > http://www.voidspace.org.uk/python/index.shtml > > >> >> >>> Every page in indextree has a 'link-title'. If this hasn't been >>> explicitly set in the restindex of a page, it defaults to the page title. >>> >>> What other values do you need access to ? >>> >>> >> Well, the page-title if link-title has been set. :) >> >> But I guess I could also just name my /index.txt "Introduction" >> (which is the current link_title) and use site-wide uservalues to >> define the site title. >> >> Thanks again for your continued patience and support! >> >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to share your >> opinions on IT & business topics through brief surveys -- and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Rest2web-develop mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/rest2web-develop >> >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > > |
From: Michael F. <fuz...@vo...> - 2006-08-05 15:05:34
|
martin f krafft wrote: > also sprach Michael Foord <mi...@pc...> [2006.08.05.1426 +0100]: > >> Which is perhaps a little ugly. :-) >> >> The better way of achieving this is to provide uservalues in your site >> config file. These are already available to every page. >> > > by site config file, you mean .ini file? > > Yes. >> You can't access the restindex or uservalues of pages through >> indextree. >> > > Mh, this is not what I wanted to hear... would it be possible to add > this? I think it would just make it a whole lot more flexible, > especially since indextree seems to be the structure representing > the entire site and hence needs to be used for a lot of different > functions. > Don't forget that rest2web is built top down. The indextree only contains information for pages/directories above the one currently being rendered, not for the whole site. I've now (experimentally) added the restindex and uservalues for each page into the indextree. Now checked in. Please let me know if this works for you. Fuzzyman http://www.voidspace.org.uk/python/index.shtml > >> Every page in indextree has a 'link-title'. If this hasn't been >> explicitly set in the restindex of a page, it defaults to the page title. >> >> What other values do you need access to ? >> > > Well, the page-title if link-title has been set. :) > > But I guess I could also just name my /index.txt "Introduction" > (which is the current link_title) and use site-wide uservalues to > define the site title. > > Thanks again for your continued patience and support! > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Rest2web-develop mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/rest2web-develop > |
From: martin f k. <ma...@ma...> - 2006-08-05 13:56:24
|
also sprach Michael Foord <mi...@pc...> [2006.08.05.1426 +0100]: > Which is perhaps a little ugly. :-) >=20 > The better way of achieving this is to provide uservalues in your site=20 > config file. These are already available to every page. by site config file, you mean .ini file? > You can't access the restindex or uservalues of pages through > indextree. Mh, this is not what I wanted to hear... would it be possible to add this? I think it would just make it a whole lot more flexible, especially since indextree seems to be the structure representing the entire site and hence needs to be used for a lot of different functions. > Every page in indextree has a 'link-title'. If this hasn't been=20 > explicitly set in the restindex of a page, it defaults to the page title. >=20 > What other values do you need access to ? Well, the page-title if link-title has been set. :) But I guess I could also just name my /index.txt "Introduction" (which is the current link_title) and use site-wide uservalues to define the site title. Thanks again for your continued patience and support! --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 SUSE: Soll Unix Sein, Eigentlich. |
From: Michael F. <fuz...@vo...> - 2006-08-05 13:27:42
|
martin f krafft wrote: > also sprach Michael Foord <mi...@pc...> [2006.08.05.1305 +0100]: > >> martin f krafft wrote: >> >>> also sprach Michael Foord <mi...@pc...> [2006.08.05.1158 +0100]: >>> >>> >>>> Yes indextree['parent'] is always None. >>>> >>>> >>> Ok. >>> >>> >>> >>>> I *think* I see what you want to do. You want a single index page >>>> which only shows pages from the selected section. I could probably >>>> achieve that with javascript, but I wouldn't know how to do it >>>> with CSS. :-) >>>> >>>> >>> No no, much easier. I simply want a list of categories (let's not >>> call them sections) as defined in the root, to show up on all pages >>> of the site. I want one of those categories to be hilighted, >>> depending on where we are in the site. >>> >>> Pseudocode: >>> >>> def current_url_matches_category(page, cat): >>> // ... >>> >>> print '<ol id="globalsect">' >>> for cat in indextree['categories']: >>> if current_url_matches_category(page, cat): >>> print '<li class="current">' + cat['link title'] + '</li>' >>> else: >>> print '<li><a href="%s">%s</a></li>' % (cat['base_url'], >>> cat['link_title']) >>> >>> >>> >> Hmm... on reading your pseudocode a bit more carefully.... :-) >> >> You want every 'category' to have a 'base_url' as well. >> >> This isn't something that is really directly available in rest2web - you >> want global categories and information available to every page. >> >> You could then set the category for each page in a uservalue. >> >> How about if I add some 'globals' to rest2web that are available in >> every page? >> > > This would be a nice feature to have. Think site_title: > > <title><% title %> - <% site_title %></title> > > I have just added 'globalValues'. You could now do something like : try: site_title except NameError: site_title = globalValues['site_title'] else: globalValues['site_title'] = site_title Which is perhaps a little ugly. :-) The better way of achieving this is to provide uservalues in your site config file. These are already available to every page. >> You would set these in the top level, and could use them from every >> page. Your code would look something like (in your template) : >> >> <# >> >> # This code will only be executed once >> # It could be kept in an external module and imported >> if not categories in globalValues: >> categories = {} >> categories['category 1'] = {'base_url': '/url1', >> 'link_title': 'link title 1'} >> categories['category 2'] = {'base_url': '/url2', >> 'link_title': 'link title >> 2'} >> globalValues['categories'] = categories >> >> #> >> >> Feel free to suggest a better name than globalValues. :-) >> >> You could find a better way of setting up the categories than hardcoding >> them into your code, based on the other values available to you. *You* >> still have to decide which is the base url for your categories though. >> > > Well, I think that subdirectories would make perfect sense. > > Now I have to figure out how to use the indextree structure: > > - how do I get a page's uservalues? In an earlier mail, you told > me to use indextree['namespace']['myvalue'], but there is no > item 'namespace' in the indextree structure. > I thought I suggested (I should have done) : sections['section name']['pages'][pageIndex]['namespace'] or : for section in sections.values(): for page in section['pages']: namespace = page['namespace'] This only gives you access to pages in the current directory though., and index pages of the directories below. > - how do I get at other restindex values? For instance, if > I needed to read a page's page-title, how would I do that. > > You can't access the restindex or uservalues of pages through indextree. Every page in indextree has a 'link-title'. If this hasn't been explicitly set in the restindex of a page, it defaults to the page title. What other values do you need access to ? Fuzzyman http://www.voidspace.org.uk/python/index.shtml >> If you then set a 'category' uservalue in each page, your pseudocode >> becomes : >> >> <# >> >> print '<ol id="globalsect">' >> for (catName, cat) in globalValues['categories'].items(): >> if category == catName: >> print '<li class="current">' + cat['link_title'] + '</li>' >> else: >> print '<li><a href="%s">%s</a></li>' % (cat['base_url'], >> cat['link_title']) >> >> #> >> >> How does that seem ? >> > > (I am not trimming the reply because this goes out to the mailing > list). > > |
From: martin f k. <ma...@ma...> - 2006-08-05 13:27:27
|
also sprach Michael Foord <fuz...@vo...> [2006.08.05.1422 +010= 0]: > A directory is *only* processed if it has an index.txt. Ouch. But at least the mailing list seems to be working. I will try to subscribe for the third time. --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 the heineken uncertainty principle: you can never be sure how many beers you had last night. |
From: Michael F. <fuz...@vo...> - 2006-08-05 13:18:47
|
martin f krafft wrote: > > I am now running up against a new problem, testing: > > $ r2w > [...] > Building contact.html > [...] > Processing "sub" directory. > $ mkdir foo > $ cp contact.txt foo/bar.txt > $ r2w > [...] > Building contact.html > Skipping "contact.html". Identical file exists. > [...] > Processing "foo" directory. > > Processing "sub" directory. > [...] > > It's just ignoring the foo/bar.txt file... > A directory is *only* processed if it has an index.txt. rest2web is designed to create sites that are structured using directories. Each directory can optionally be divided into sections. It is expected that each directory has an index page (because they are rendered differently, and rest2web needs to know which one is the index page). If you *don't* want the main page in a directory to be called 'index.html' there are a couple of ways of achieving this. Index page is called index.txt : restindex target: bar.html /restindex You want the index page to be called something else. You will still need an index.txt for the directory to be processed : restindex index-file: bar.txt /restindex All the best, Fuzzyman http://www.voidspace.org.uk/python/index.shtml |
From: Michael F. <fuz...@vo...> - 2006-08-05 13:09:08
|
Gael Varoquaux wrote: > On Sat, Aug 05, 2006 at 01:53:24PM +0100, martin f krafft wrote: > >>> How about if I add some 'globals' to rest2web that are available in >>> every page? >>> > > >> This would be a nice feature to have. Think site_title: >> > > >> <title><% title %> - <% site_title %></title> >> > > Yes !! I like that. > You can supply global uservalues in your config now. So you could define 'site_title' in your config file : [uservalues] site_title = 'A Sitewide Title' Fuzzyman http://www.voidspace.org.uk/python/index.shtml |
From: Gael V. <gae...@no...> - 2006-08-05 13:06:40
|
On Fri, Aug 04, 2006 at 02:54:43PM +0100, martin f krafft wrote: > here's another question for you... take a look at > http://ailab.ch.org and take note of the section tabs on the left > hand side... if you click on one, it gets you to the subsection and > then stays highlighted. I cannot find http://ailab.ch.org but would something like http://gael-varoquaux.info satisfy you ? --=20 Ga=EBl |
From: Gael V. <gae...@no...> - 2006-08-05 13:04:54
|
On Sat, Aug 05, 2006 at 01:53:24PM +0100, martin f krafft wrote: > > How about if I add some 'globals' to rest2web that are available in=20 > > every page? > This would be a nice feature to have. Think site_title: > <title><% title %> - <% site_title %></title> Yes !! I like that. --=20 Ga=EBl |
From: martin f k. <ma...@ma...> - 2006-08-05 12:58:35
|
also sprach Michael Foord <mi...@pc...> [2006.08.05.1245 +0100]: > martin f krafft wrote: > >also sprach Michael Foord <mi...@pc...> [2006.08.05.1158 +0100]: > > =20 > >>Yes indextree['parent'] is always None. > >> =20 > > > >Ok. > > > > =20 > >>I *think* I see what you want to do. You want a single index page > >>which only shows pages from the selected section. I could probably > >>achieve that with javascript, but I wouldn't know how to do it > >>with CSS. :-) > >> =20 > > > >No no, much easier. I simply want a list of categories (let's not > >call them sections) as defined in the root, to show up on all pages > >of the site. I want one of those categories to be hilighted, > >depending on where we are in the site. > > > > =20 > Does your site have many directories ? No. > >Pseudocode: > > > > def current_url_matches_category(page, cat): > > // ... > > > > print '<ol id=3D"globalsect">' > > for cat in indextree['categories']: > > if current_url_matches_category(page, cat): > > print '<li class=3D"current">' + cat['link title'] + '</li>' > > else: > > print '<li><a href=3D"%s">%s</a></li>' % (cat['base_url'],=20 > > cat['link_title']) > > > > =20 > By current URL you mean the current page being rendered I assume. Yes. > You can get the 'category' of the current page from : >=20 > thispage['section'] Well, I understand sections to be per directory. My "categories" need to be site-wide. > So assuming every directory has the same categories, your code above=20 > should be fairly simple... >=20 > Could you try again with the sourceforge mailing list ? Done. Thus not trimming. I am now running up against a new problem, testing: $ r2w [...] Building contact.html [...] Processing "sub" directory. $ mkdir foo $ cp contact.txt foo/bar.txt $ r2w [...] Building contact.html Skipping "contact.html". Identical file exists. [...] Processing "foo" directory. Processing "sub" directory. [...] It's just ignoring the foo/bar.txt file... --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 philosophy: unintelligible answers to insoluble problems. |
From: martin f k. <ma...@ma...> - 2006-08-05 12:58:24
|
also sprach Michael Foord <mi...@pc...> [2006.08.05.1305 +0100]: > martin f krafft wrote: > >also sprach Michael Foord <mi...@pc...> [2006.08.05.1158 +0100]: > > =20 > >>Yes indextree['parent'] is always None. > >> =20 > > > >Ok. > > > > =20 > >>I *think* I see what you want to do. You want a single index page > >>which only shows pages from the selected section. I could probably > >>achieve that with javascript, but I wouldn't know how to do it > >>with CSS. :-) > >> =20 > > > >No no, much easier. I simply want a list of categories (let's not > >call them sections) as defined in the root, to show up on all pages > >of the site. I want one of those categories to be hilighted, > >depending on where we are in the site. > > > >Pseudocode: > > > > def current_url_matches_category(page, cat): > > // ... > > > > print '<ol id=3D"globalsect">' > > for cat in indextree['categories']: > > if current_url_matches_category(page, cat): > > print '<li class=3D"current">' + cat['link title'] + '</li>' > > else: > > print '<li><a href=3D"%s">%s</a></li>' % (cat['base_url'],=20 > > cat['link_title']) > > > > =20 > Hmm... on reading your pseudocode a bit more carefully.... :-) >=20 > You want every 'category' to have a 'base_url' as well. >=20 > This isn't something that is really directly available in rest2web - you= =20 > want global categories and information available to every page. >=20 > You could then set the category for each page in a uservalue. >=20 > How about if I add some 'globals' to rest2web that are available in=20 > every page? This would be a nice feature to have. Think site_title: <title><% title %> - <% site_title %></title> > You would set these in the top level, and could use them from every=20 > page. Your code would look something like (in your template) : >=20 > <# >=20 > # This code will only be executed once > # It could be kept in an external module and imported > if not categories in globalValues: > categories =3D {} > categories['category 1'] =3D {'base_url': '/url1', > 'link_title': 'link title 1'} > categories['category 2'] =3D {'base_url': '/url2', > 'link_title': 'link title=20 > 2'} =20 > globalValues['categories'] =3D categories >=20 > #> >=20 > Feel free to suggest a better name than globalValues. :-) >=20 > You could find a better way of setting up the categories than hardcoding= =20 > them into your code, based on the other values available to you. *You*=20 > still have to decide which is the base url for your categories though. Well, I think that subdirectories would make perfect sense. Now I have to figure out how to use the indextree structure: - how do I get a page's uservalues? In an earlier mail, you told me to use indextree['namespace']['myvalue'], but there is no item 'namespace' in the indextree structure. - how do I get at other restindex values? For instance, if I needed to read a page's page-title, how would I do that. > If you then set a 'category' uservalue in each page, your pseudocode=20 > becomes : >=20 > <# >=20 > print '<ol id=3D"globalsect">' > for (catName, cat) in globalValues['categories'].items(): > if category =3D=3D catName: > print '<li class=3D"current">' + cat['link_title'] + '</li>' > else: > print '<li><a href=3D"%s">%s</a></li>' % (cat['base_url'],=20 > cat['link_title']) >=20 > #> >=20 > How does that seem ? (I am not trimming the reply because this goes out to the mailing list). --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 nasa spent 2 billion dollars on the research of a ballpoint pen that could write on everything, even upside down, under water, or at extreme temperatures; the russians used a pencil. (but see: http://www.snopes.com/business/genius/spacepen.asp) |
From: martin f k. <ma...@ma...> - 2006-08-05 12:58:20
|
Michael, here's another question for you... take a look at http://ailab.ch.org and take note of the section tabs on the left hand side... if you click on one, it gets you to the subsection and then stays highlighted. The way I did this was with CSS, setting the "selected" class based on the current URL and the name of the section. So, for instance, if the URL was /projects/adapt, then the entry for /projects would get the selected class. How would I do this with rest2web? There are sections and while it would be trivial to figure out the current page's section and set the class accordingly, I cannot iterate through the sections to generate the list and get a single target URL for each section, there is no "main page" of a section. I basically want/need a navigation method that's not like the sidebar and not like minibar, but site-wide. Cheers, --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 spamtraps: mad...@ma... =20 "with sufficient thrust, pigs fly just fine. however, this is not necessarily a good idea. it is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead." -- rfc 1925 |
From: Michael F. <mic...@re...> - 2006-08-04 13:43:56
|
Michael Foord wrote: > make_dist.py now takes a 'nopause' option as a command line argument. > > Breadcrumbs patch applied. (More readable HTML and '>' default > separator) > > Fixed bug when ``final_encoding`` is ``None``. > > Default config file is now ``r2w.ini``. ``rest2web.ini`` is still > supported for backwards compatibility. (To be removed in a future > version). > > Fixed bug with ``standerr`` where no logfile is used. > Above changes (plus some minor doc updates) now applied to SVN, repository was down again last night. As this was the first interruption in the otherwise good (and free) service from Python-hosting, I'm inclined to trust them for a while. Still further doc changes to do, bug to fix with 'thispage', and possible changes to 'include' before release will be done. Fuzzyman http://www.voidspace.org.uk/python/index.shtml |