David Goodger <goodger@...> writes:
> [Martin Geisler]
>> Is there a way to get hold of the current document name from within a
> From within the processing code, yes. It's in document.source.
> From within the document text? No.
Okay, I was afraid so. Wouldn't it be a good idea to expose such a
variable to the document? Having access to variables containing stuff
* file name (relative to where buildhtml.py was invoked)
* modification time
would satisfy my immediate theming needs.
In general I would love to have an integration between Genshi (the XML
templater from Trac) and Docutils so that I could program my way out of
such things in a Genshi template, but still specify the document text
using reSt syntax.
Does such a thing exist?
>> I store my documents in a revision control system, and want to
>> include a common footer that points to the history of the current
>> document. So if foo/bar.txt is processed (by buildhtml.py by the
>> way), I want to get a URL like
>> in the output. Can this be done?
> You can use the --source-link option (source_link config setting) to
> insert such a link in the document footers. It's a relative link
> though, possibly not suitable for your purposes.
Yeah, I found that -- and you are right, it doesn't quite work.
> A substitution directive could be defined, like the "date" directive.
> To produce a full URL like what you want, the directive would have to
> construct the URL from the source link and a URL prefix (which would
> depend on the path). It'd be tricky to get exactly the behavior I
> think you want.
Okay, I'll see if I can come up with something.
Thanks for the reply!
VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multi-Party Computation) to Python. See: http://viff.dk/.