Chris G wrote:
> On Mon, Apr 02, 2007 at 12:21:33AM +0100, Michael Foord wrote:
>
>> Chris G wrote:
>>
>>> When using the <* .... *> syntax to insert something into a rst page
>>> what variables are available?
>>>
>>> I tried 'title' and was told that wasn't defined and I suppose that's
>>> not unreasonable. Then I tried 'pagename' and that was undefined too
>>> which doesn't seem right to me, surely the filename should be known.
>>>
>>>
>> Looking at the code (call to 'render_well' in line 934 of
>> restprocessor.py), only the uservalues are available at this point.
>>
>> What is your usecase for knowing the filename at this point ? (I only
>> envisaged uservalues being used here - but it *could* be used for
>> general templating.)
>>
>> Anyway - I note your feature request to add more values here - a strong
>> use case might speed it up. :-)
>>
>> (By the way, this is a *slightly* obscure feature of rest2web - it is
>> good to see it getting used. :-)
>>
>>
> I want to use it in the default index.txt file so that I can put (for
> example) the file name as the default section header. E.g. :-
>
> <* pagename *>
> ======================
>
> at the top of the default index.txt would give a reasonable default
> heading and would also get into all the rest2web structures for use as
> link names etc. Doing it in a raw:: html section would only create
> the heading but not set any values.
>
Ok - that's a reasonable usecase.
I'll try and implement it ASAP, but I can't promise when. :-)
Michael
|