From 4239bb0f35d40f820e344a55338f8bbe5ae9eb98 Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Wed, 27 Oct 2010 15:35:07 +0000 Subject: 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 --- docs/_ext/djangodocs.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/_ext/djangodocs.py') 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 -- cgit v1.2.1