Re: [Rest2web-develop] Feature request: specify header level for rest docs
Brought to you by:
mjfoord
|
From: Fuzzyman <fuz...@vo...> - 2006-02-15 11:28:17
|
Andrew Ittner wrote:
> For some of the files in my site I have a macro that returns a <h1> block.
> The files that are written in rest format automatically start the headers at
> <h1> and work down.
>
> I want the ability to specify in the restindex at what level the header
> should start. A restindex keyword like "headerlevel=2" would tell the
> parser to start the rest portion of the headers at <h2>, leaving me free to
> set an <h1> manually.
>
>
I *can* add this. It's yet another restindex option. *sigh* I'd like to
minimize the number of additional restindex keywords, but in this case
there doesn't seem to be a cleaner alternative. As it's likely to need
to be a global setting (not vary through a site), perhaps it could be
added to the config file instead ? I will shortly be adding the
possibility of global settings in the config file for plugins. Would
this work for you Andrew ?
3 short term fixes spring to mind, all slightly hackish :
* ReST puts a class on all headlines it generates. You can just use CSS
to control their appearance.
* You could use a ``{title;Title Text;2}`` macro to do your headings. I
use this because putting proper titles into a ReST document triggers the
creation of ``sections`` which has unfortunate side effects where I want
to control the way paragraphs are in div containers. (ReST doesn't allow
any content between sections.)
* The function to modify to simply hardwire the change is ``html_parts``
in ``rest2web/restutils.py``. Set the default ``initial_header_level`` to 2.
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> Thanks,
>
> Andrew Ittner
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Rest2web-develop mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/rest2web-develop
>
>
|