mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #5922 from tk0miya/refactor_latex_compat
Fix recursive import when importing sphinx.writers.latex directly
This commit is contained in:
commit
c47d8d3d0d
@ -1,31 +0,0 @@
|
|||||||
"""
|
|
||||||
sphinx.builders.latex.compat
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Compatibility module for LaTeX writer.
|
|
||||||
This module will be removed after deprecation period.
|
|
||||||
Don't use components in this modules directly.
|
|
||||||
|
|
||||||
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
|
|
||||||
:license: BSD, see LICENSE for details.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform
|
|
||||||
from sphinx.builders.latex.util import ExtBabel
|
|
||||||
from sphinx.deprecation import (
|
|
||||||
RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
deprecated_alias('sphinx.writers.latex',
|
|
||||||
{
|
|
||||||
'ShowUrlsTransform': ShowUrlsTransform,
|
|
||||||
'URI_SCHEMES': URI_SCHEMES,
|
|
||||||
},
|
|
||||||
RemovedInSphinx30Warning)
|
|
||||||
|
|
||||||
deprecated_alias('sphinx.writers.latex',
|
|
||||||
{
|
|
||||||
'ExtBabel': ExtBabel,
|
|
||||||
},
|
|
||||||
RemovedInSphinx40Warning)
|
|
@ -22,10 +22,9 @@ from docutils import nodes, writers
|
|||||||
|
|
||||||
from sphinx import addnodes
|
from sphinx import addnodes
|
||||||
from sphinx import highlighting
|
from sphinx import highlighting
|
||||||
from sphinx.builders.latex.nodes import (
|
from sphinx.deprecation import (
|
||||||
HYPERLINK_SUPPORT_NODES, captioned_literal_block, footnotetext
|
RemovedInSphinx30Warning, RemovedInSphinx40Warning, deprecated_alias
|
||||||
)
|
)
|
||||||
from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning
|
|
||||||
from sphinx.domains.std import StandardDomain
|
from sphinx.domains.std import StandardDomain
|
||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.locale import admonitionlabels, _, __
|
from sphinx.locale import admonitionlabels, _, __
|
||||||
@ -2603,4 +2602,22 @@ class LaTeXTranslator(SphinxTranslator):
|
|||||||
|
|
||||||
|
|
||||||
# Import old modules here for compatibility
|
# Import old modules here for compatibility
|
||||||
import sphinx.builders.latex.compat # NOQA
|
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA
|
||||||
|
from sphinx.builders.latex.util import ExtBabel # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
deprecated_alias('sphinx.writers.latex',
|
||||||
|
{
|
||||||
|
'ShowUrlsTransform': ShowUrlsTransform,
|
||||||
|
'URI_SCHEMES': URI_SCHEMES,
|
||||||
|
},
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
deprecated_alias('sphinx.writers.latex',
|
||||||
|
{
|
||||||
|
'ExtBabel': ExtBabel,
|
||||||
|
},
|
||||||
|
RemovedInSphinx40Warning)
|
||||||
|
|
||||||
|
# FIXME: Workaround to avoid circular import
|
||||||
|
# refs: https://github.com/sphinx-doc/sphinx/issues/5433
|
||||||
|
from sphinx.builders.latex.nodes import HYPERLINK_SUPPORT_NODES, captioned_literal_block, footnotetext # NOQA
|
||||||
|
Loading…
Reference in New Issue
Block a user