1 May 2003 01:30
Re: Custom behaviour in reST
Aahz <aahz <at> pythoncraft.com>
2003-04-30 23:30:10 GMT
2003-04-30 23:30:10 GMT
On Thu, May 01, 2003, Magnus Lyckå wrote: > > I hope I'm not just reiterating some old discussion you've > been through before here... Not quite, but close to it.(Continue reading)> Are there in-line versions of the directives as well? Maybe > I want a python style expression in the middle of a paragraph? That's interpreted text and roles:: :chapter:`Foo` for example. > Is it possible to have site specific directives without having > to patch docutils? I.e, do they work as plug-ins? My quick look > at the code seems to suggest that you would hand-edit the dict > _directive_registry in directives/__init__.py, but maybe I > missed something. (Either way, I assume it's better to fix that > then to add another layer of code.) From OOdirectives.py (part of my hacked OpenOffice writer):: from docutils.parsers.rst import directives from docutils.parsers.rst.languages import en registry = directives._directive_registry registry['include-code'] = ('OOdirectives', 'include_code')
> Are there in-line versions of the directives as well? Maybe
> I want a python style expression in the middle of a paragraph?
That's interpreted text and roles::
:chapter:`Foo`
for example.
> Is it possible to have site specific directives without having
> to patch docutils? I.e, do they work as plug-ins? My quick look
> at the code seems to suggest that you would hand-edit the dict
> _directive_registry in directives/__init__.py, but maybe I
> missed something. (Either way, I assume it's better to fix that
> then to add another layer of code.)
From OOdirectives.py (part of my hacked OpenOffice writer)::
from docutils.parsers.rst import directives
from docutils.parsers.rst.languages import en
registry = directives._directive_registry
registry['include-code'] = ('OOdirectives', 'include_code')
RSS Feed