diff options
author | Ramiro Morales <cramm0@gmail.com> | 2010-10-27 15:35:07 +0000 |
---|---|---|
committer | Ramiro Morales <cramm0@gmail.com> | 2010-10-27 15:35:07 +0000 |
commit | 4239bb0f35d40f820e344a55338f8bbe5ae9eb98 (patch) | |
tree | 86f01dafdfb67615bea00ffca810c4bc74522d6f /docs/_ext/djangodocs.py | |
parent | 0b39bf02b94be859b418e1fbc19e50be8100c0f3 (diff) | |
download | django-4239bb0f35d40f820e344a55338f8bbe5ae9eb98.tar.gz |
Documented options accepted by the runfcgi management command.
Also, modified our custom management command option docs xref parser
to also process those without a ``--`` prefix. -- Refs #14398.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/_ext/djangodocs.py')
-rw-r--r-- | docs/_ext/djangodocs.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/_ext/djangodocs.py b/docs/_ext/djangodocs.py index 325ed76cdc..022ec3acd3 100644 --- a/docs/_ext/djangodocs.py +++ b/docs/_ext/djangodocs.py @@ -2,6 +2,7 @@ Sphinx plugins for Django documentation. """ import os +import re from docutils import nodes, transforms try: @@ -21,6 +22,9 @@ from sphinx.writers.html import SmartyPantsHTMLTranslator from sphinx.util.console import bold from sphinx.util.compat import Directive +# RE for option descriptions without a '--' prefix +simple_option_desc_re = re.compile( + r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)') def setup(app): app.add_crossref_type( @@ -207,6 +211,16 @@ def parse_django_adminopt_node(env, sig, signode): if not count: firstname = optname count += 1 + if not count: + for m in simple_option_desc_re.finditer(sig): + optname, args = m.groups() + if count: + signode += addnodes.desc_addname(', ', ', ') + signode += addnodes.desc_name(optname, optname) + signode += addnodes.desc_addname(args, args) + if not count: + firstname = optname + count += 1 if not firstname: raise ValueError return firstname |