Fixed #985 -- Fixed admin docs behavior if docutils isn't installed. Thanks, Tim Keating

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-12-07 05:11:19 +00:00
parent 4ed33777be
commit 7106c68e59
1 changed files with 6 additions and 4 deletions

View File

@ -90,8 +90,10 @@ def default_reference_role(name, rawtext, text, lineno, inliner, options={}, con
context = inliner.document.settings.default_reference_context context = inliner.document.settings.default_reference_context
node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text)), **options) node = docutils.nodes.reference(rawtext, text, refuri=(ROLES[context] % (inliner.document.settings.link_base, text)), **options)
return [node], [] return [node], []
docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
for (name, urlbase) in ROLES.items(): if docutils_is_available:
create_reference_role(name, urlbase) docutils.parsers.rst.roles.register_canonical_role('cmsreference', default_reference_role)
docutils.parsers.rst.roles.DEFAULT_INTERPRETED_ROLE = 'cmsreference'
for (name, urlbase) in ROLES.items():
create_reference_role(name, urlbase)