Changeset View
Changeset View
Standalone View
Standalone View
lldb/docs/conf.py
Show All 23 Lines | if not building_man_page: | ||||
# add these directories to sys.path here. If the directory is relative to the | # add these directories to sys.path here. If the directory is relative to the | ||||
# documentation root, use os.path.abspath to make it absolute, like shown here. | # documentation root, use os.path.abspath to make it absolute, like shown here. | ||||
# Add the current directory that contains the mock _lldb native module which | # Add the current directory that contains the mock _lldb native module which | ||||
# is imported by the `lldb` module. | # is imported by the `lldb` module. | ||||
sys.path.insert(0, os.path.abspath(".")) | sys.path.insert(0, os.path.abspath(".")) | ||||
# Add the build directory that contains the `lldb` module. LLDB_SWIG_MODULE is | # Add the build directory that contains the `lldb` module. LLDB_SWIG_MODULE is | ||||
# set by CMake. | # set by CMake. | ||||
if os.getenv("LLDB_SWIG_MODULE") is not None: | |||||
sys.path.insert(0, os.getenv("LLDB_SWIG_MODULE")) | sys.path.insert(0, os.getenv("LLDB_SWIG_MODULE")) | ||||
JDevlieghere: Why is this necessary? It sounds like CMake should be setting this variable. | |||||
siger-youngAuthorUnsubmitted At the beginning, I was using ninja lldb-docs-html to build the docs. But it seems that it will build all of the docs each time it runs. It wastes some time, so I turn to sphinx-build command to build it, thus the env might become None. If extension sphinx_tabs.tabs is added, None value in sys.path will affect its importing. siger-young: At the beginning, I was using `ninja lldb-docs-html` to build the docs. But it seems that it… | |||||
# Put the generated Python API documentation in the 'python_api' folder. This | # Put the generated Python API documentation in the 'python_api' folder. This | ||||
# also defines the URL these files will have in the generated website. | # also defines the URL these files will have in the generated website. | ||||
automodapi_toctreedirnm = 'python_api' | automodapi_toctreedirnm = 'python_api' | ||||
# Disable sphinx-tabs tab closing feature. | |||||
sphinx_tabs_disable_tab_closing = True | |||||
# -- General configuration ----------------------------------------------------- | # -- General configuration ----------------------------------------------------- | ||||
# If your documentation needs a minimal Sphinx version, state it here. | # If your documentation needs a minimal Sphinx version, state it here. | ||||
#needs_sphinx = '1.0' | #needs_sphinx = '1.0' | ||||
# Add any Sphinx extension module names here, as strings. They can be extensions | # Add any Sphinx extension module names here, as strings. They can be extensions | ||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. | ||||
extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx'] | extensions = ['sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', 'sphinx_tabs.tabs'] | ||||
# Unless we only generate the basic manpage we need the plugin for generating | # Unless we only generate the basic manpage we need the plugin for generating | ||||
# the Python API documentation. | # the Python API documentation. | ||||
if not building_man_page: | if not building_man_page: | ||||
extensions.append('sphinx_automodapi.automodapi') | extensions.append('sphinx_automodapi.automodapi') | ||||
# Add any paths that contain templates here, relative to this directory. | # Add any paths that contain templates here, relative to this directory. | ||||
templates_path = ['_templates'] | templates_path = ['_templates'] | ||||
# The suffix of source filenames. | # The suffix of source filenames. | ||||
source_suffix = { | source_suffix = { | ||||
'.rst': 'restructuredtext', | '.rst': 'restructuredtext', | ||||
} | } | ||||
try: | try: | ||||
import recommonmark | import recommonmark | ||||
except ImportError: | except ImportError: | ||||
# manpages do not use any .md sources | # manpages do not use any .md sources | ||||
if not building_man_page: | if not building_man_page: | ||||
raise | raise | ||||
else: | else: | ||||
import sphinx | import sphinx | ||||
if sphinx.version_info >= (3, 0): | if sphinx.version_info >= (3, 0): | ||||
# This requires 0.5 or later. | # This requires 0.5 or later. | ||||
extensions.append('recommonmark') | extensions.append('recommonmark') | ||||
else: | else: | ||||
source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} | source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'} | ||||
source_suffix['.md'] = 'markdown' | source_suffix['.md'] = 'markdown' | ||||
JDevlieghereUnsubmitted Not Done ReplyInline ActionsUnrelated change? JDevlieghere: Unrelated change? | |||||
siger-youngAuthorUnsubmitted Yes, it's unrelated. siger-young: Yes, it's unrelated. | |||||
# The encoding of source files. | # The encoding of source files. | ||||
#source_encoding = 'utf-8-sig' | #source_encoding = 'utf-8-sig' | ||||
# The master toctree document. | # The master toctree document. | ||||
master_doc = 'index' | master_doc = 'index' | ||||
# General information about the project. | # General information about the project. | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
# pixels large. | # pixels large. | ||||
#html_favicon = None | #html_favicon = None | ||||
# Add any paths that contain custom static files (such as style sheets) here, | # Add any paths that contain custom static files (such as style sheets) here, | ||||
# relative to this directory. They are copied after the builtin static files, | # relative to this directory. They are copied after the builtin static files, | ||||
# so a file named "default.css" will overwrite the builtin "default.css". | # so a file named "default.css" will overwrite the builtin "default.css". | ||||
html_static_path = ['_static'] | html_static_path = ['_static'] | ||||
html_context = { | # Add any extra stylesheets and scripts here. | ||||
'css_files': [ | html_css_files = ['lldb.css'] | ||||
'_static/lldb.css' | html_js_files = [] | ||||
JDevlieghereUnsubmitted Not Done ReplyInline ActionsWhy is this necessary? JDevlieghere: Why is this necessary? | |||||
siger-youngAuthorUnsubmitted When I built the docs using the html_context, the final pages only include lldb.css, missing files from theme e.g. alabaster.css. siger-young: When I built the docs using the `html_context`, the final pages only include `lldb.css`… | |||||
JDevlieghereUnsubmitted Not Done ReplyInline ActionsDoes this not break building the docs with ninja lldb-docs-html? JDevlieghere: Does this not break building the docs with `ninja lldb-docs-html`? | |||||
], | |||||
} | |||||
html_extra_path = ['.htaccess'] | html_extra_path = ['.htaccess'] | ||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, | ||||
# using the given strftime format. | # using the given strftime format. | ||||
html_last_updated_fmt = '%b %d, %Y' | html_last_updated_fmt = '%b %d, %Y' | ||||
# If true, SmartyPants will be used to convert quotes and dashes to | # If true, SmartyPants will be used to convert quotes and dashes to | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
# Additional stuff for the LaTeX preamble. | # Additional stuff for the LaTeX preamble. | ||||
#'preamble': '', | #'preamble': '', | ||||
} | } | ||||
# Grouping the document tree into LaTeX files. List of tuples | # Grouping the document tree into LaTeX files. List of tuples | ||||
# (source start file, target name, title, author, documentclass [howto/manual]). | # (source start file, target name, title, author, documentclass [howto/manual]). | ||||
latex_documents = [ | latex_documents = [ | ||||
('index', 'LLDB.tex', u'LLDB Documentation', | ('index', 'LLDB.tex', u'LLDB Documentation', | ||||
u'The LLDB Team', 'manual'), | u'The LLDB Team', 'manual'), | ||||
] | ] | ||||
# The name of an image file (relative to this directory) to place at the top of | # The name of an image file (relative to this directory) to place at the top of | ||||
# the title page. | # the title page. | ||||
#latex_logo = None | #latex_logo = None | ||||
# For "manual" documents, if this is true, then toplevel headings are parts, | # For "manual" documents, if this is true, then toplevel headings are parts, | ||||
# not chapters. | # not chapters. | ||||
Show All 38 Lines | with open(os.path.join(command_guide_path, name)) as f: | ||||
m.group(2), man_page_authors, 1)) | m.group(2), man_page_authors, 1)) | ||||
# -- Options for Texinfo output ------------------------------------------------ | # -- Options for Texinfo output ------------------------------------------------ | ||||
# Grouping the document tree into Texinfo files. List of tuples | # Grouping the document tree into Texinfo files. List of tuples | ||||
# (source start file, target name, title, author, | # (source start file, target name, title, author, | ||||
# dir menu entry, description, category) | # dir menu entry, description, category) | ||||
texinfo_documents = [ | texinfo_documents = [ | ||||
('index', 'LLDB', u'LLDB Documentation', | ('index', 'LLDB', u'LLDB Documentation', | ||||
u'The LLDB Team', 'LLDB', 'One line description of project.', | u'The LLDB Team', 'LLDB', 'One line description of project.', | ||||
'Miscellaneous'), | 'Miscellaneous'), | ||||
JDevlieghereUnsubmitted Not Done ReplyInline ActionsUnrelated whitespace change? JDevlieghere: Unrelated whitespace change? | |||||
siger-youngAuthorUnsubmitted Yes. siger-young: Yes. | |||||
] | ] | ||||
# Documents to append as an appendix to all manuals. | # Documents to append as an appendix to all manuals. | ||||
#texinfo_appendices = [] | #texinfo_appendices = [] | ||||
# If false, no module index is generated. | # If false, no module index is generated. | ||||
#texinfo_domain_indices = True | #texinfo_domain_indices = True | ||||
Show All 35 Lines |
Why is this necessary? It sounds like CMake should be setting this variable.