mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use get_settings()
from Docutils 0.19 (#10624)
This commit is contained in:
parent
cf8d5357fc
commit
8d99168794
@ -229,8 +229,11 @@ class StandaloneHTMLBuilder(Builder):
|
||||
source_class=DocTreeInput,
|
||||
destination=StringOutput(encoding='unicode'),
|
||||
)
|
||||
op = pub.setup_option_parser(output_encoding='unicode', traceback=True)
|
||||
pub.settings = op.get_default_values()
|
||||
if docutils.__version_info__[:2] >= (0, 19):
|
||||
pub.get_settings(output_encoding='unicode', traceback=True)
|
||||
else:
|
||||
op = pub.setup_option_parser(output_encoding='unicode', traceback=True)
|
||||
pub.settings = op.get_default_values()
|
||||
self._publisher = pub
|
||||
|
||||
def init(self) -> None:
|
||||
|
@ -3,6 +3,7 @@ import codecs
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING, Any, List, Type
|
||||
|
||||
import docutils
|
||||
from docutils import nodes
|
||||
from docutils.core import Publisher
|
||||
from docutils.frontend import Values
|
||||
@ -212,5 +213,8 @@ def create_publisher(app: "Sphinx", filetype: str) -> Publisher:
|
||||
# Propagate exceptions by default when used programmatically:
|
||||
defaults = {"traceback": True, **app.env.settings}
|
||||
# Set default settings
|
||||
pub.settings = pub.setup_option_parser(**defaults).get_default_values() # type: ignore
|
||||
if docutils.__version_info__[:2] >= (0, 19):
|
||||
pub.get_settings(**defaults) # type: ignore[arg-type]
|
||||
else:
|
||||
pub.settings = pub.setup_option_parser(**defaults).get_default_values() # type: ignore
|
||||
return pub
|
||||
|
Loading…
Reference in New Issue
Block a user