mirror of
https://github.com/django/django.git
synced 2025-07-14 00:35:11 +00:00
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
This commit is contained in:
parent
0b39bf02b9
commit
4239bb0f35
3 changed files with 133 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue