mirror of https://github.com/django/django.git
[2.0.x] Removed usage of deprecated sphinx APIs.
Backport of cc4bb110d3
from master
This commit is contained in:
parent
aa1527db57
commit
4a62b44af3
|
@ -10,6 +10,7 @@ from docutils.parsers.rst import Directive, directives
|
|||
from sphinx import addnodes
|
||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||
from sphinx.domains.std import Cmdoption
|
||||
from sphinx.util import logging
|
||||
from sphinx.util.console import bold
|
||||
from sphinx.util.nodes import set_source_info
|
||||
|
||||
|
@ -18,6 +19,7 @@ try:
|
|||
except ImportError: # Sphinx 1.6+
|
||||
from sphinx.writers.html import HTMLTranslator
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
# RE for option descriptions without a '--' prefix
|
||||
simple_option_desc_re = re.compile(
|
||||
r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
|
||||
|
@ -44,7 +46,7 @@ def setup(app):
|
|||
rolename="lookup",
|
||||
indextemplate="pair: %s; field lookup type",
|
||||
)
|
||||
app.add_description_unit(
|
||||
app.add_object_type(
|
||||
directivename="django-admin",
|
||||
rolename="djadmin",
|
||||
indextemplate="pair: %s; django-admin command",
|
||||
|
@ -310,7 +312,7 @@ class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder):
|
|||
|
||||
def finish(self):
|
||||
super().finish()
|
||||
self.info(bold("writing templatebuiltins.js..."))
|
||||
logger.info(bold("writing templatebuiltins.js..."))
|
||||
xrefs = self.env.domaindata["std"]["objects"]
|
||||
templatebuiltins = {
|
||||
"ttags": [
|
||||
|
|
Loading…
Reference in New Issue