Re: extending semantic markup directives

2008-12-15 Thread Georg Brandl
An example extension implementing this role might look like this: from docutils import nodes, utils import posixpath def sfile_role(typ, rawtext, etext, lineno, inliner, options={}, content=[]): env = inliner.document.settings.env baseuri = env.config.sfile_base_uri text = utils.unes

Re: extending semantic markup directives

2008-12-15 Thread Dan Craig
Ok, I'll try that. If you can point me to an example, I'd appreciate it. Thanks, Dan On Dec 15, 6:38 am, Georg Brandl wrote: > Dan Craig schrieb: > > > Is it possible to add functionality to some of the semantic markup > > directives?  Specifically, I'm interested in the :file: directive. > >

Re: extending semantic markup directives

2008-12-15 Thread Georg Brandl
Dan Craig schrieb: > Is it possible to add functionality to some of the semantic markup > directives? Specifically, I'm interested in the :file: directive. > According to the documentation, all it does is format the text. I'd > like it to format the text and create a hyperlink to a source code >

extending semantic markup directives

2008-12-09 Thread Dan Craig
Is it possible to add functionality to some of the semantic markup directives? Specifically, I'm interested in the :file: directive. According to the documentation, all it does is format the text. I'd like it to format the text and create a hyperlink to a source code viewer. It looks like this