html_show_sphinx = False html_show_copyright = False html_theme_options = {"docsets": utils.get_docsets("tfm")} # Options for autosectionlabel ------------------------------------------------- autosectionlabel_prefix_document = True autosectionlabel_maxdepth = 2 # Options for external_content ------------------------------------------------- external_content_contents = [ (TFM_BASE / "docs", "index.rst"), (TFM_BASE, "docs/**/*"), (TFM_BASE, "platform/**/*"), (TFM_BASE, "tools/**/*"), ] # Options for ncs_cache -------------------------------------------------------- ncs_cache_docset = "tfm" ncs_cache_build_dir = utils.get_builddir() ncs_cache_config = NRF_BASE / "doc" / "cache.yml" ncs_cache_manifest = NRF_BASE / "west.yml" def setup(app): app.add_css_file("css/common.css") app.add_css_file("css/tfm.css")
# Paths ------------------------------------------------------------------------ NRF_BASE = Path(__file__).absolute().parents[2] sys.path.insert(0, str(NRF_BASE / "doc" / "_utils")) import utils ZEPHYR_BASE = utils.get_projdir("zephyr") # pylint: disable=undefined-variable,used-before-assignment # General ---------------------------------------------------------------------- # Import all Zephyr configuration, override as needed later os.environ["ZEPHYR_BASE"] = str(ZEPHYR_BASE) os.environ["ZEPHYR_BUILD"] = str(utils.get_builddir() / "zephyr") conf = eval_config_file(str(ZEPHYR_BASE / "doc" / "conf.py"), tags) locals().update(conf) sys.path.insert(0, str(NRF_BASE / "doc" / "_extensions")) extensions = [ "sphinx.ext.intersphinx", "ncs_cache", ] + extensions # Options for HTML output ------------------------------------------------------ html_theme = "sphinx_ncs_theme" html_theme_path = []
intersphinx_mapping["kconfig"] = kconfig_mapping nrf_mapping = utils.get_intersphinx_mapping("nrf") if nrf_mapping: intersphinx_mapping["nrf"] = nrf_mapping # -- Options for zephyr.warnings_filter ---------------------------------------- warnings_filter_config = str(NRF_BASE / "doc" / "nrfxlib" / "known-warnings.txt") # -- Options for doxyrunner plugin --------------------------------------------- doxyrunner_doxygen = os.environ.get("DOXYGEN_EXECUTABLE", "doxygen") doxyrunner_doxyfile = NRF_BASE / "doc" / "nrfxlib" / "nrfxlib.doxyfile.in" doxyrunner_outdir = utils.get_builddir() / "nrfxlib" / "doxygen" doxyrunner_fmt = True doxyrunner_fmt_vars = { "NRFXLIB_BASE": str(NRFXLIB_BASE), "OUTPUT_DIRECTORY": str(doxyrunner_outdir), } # create mbedtls config header (needed for Doxygen) doxyrunner_outdir.mkdir(exist_ok=True) fin_path = NRFXLIB_BASE / "nrf_security" / "configs" / "legacy_crypto_config.h.template" fout_path = doxyrunner_outdir / "mbedtls_doxygen_config.h" with open(fin_path) as fin, open(fout_path, "w") as fout: fout.write(re.sub(r"#cmakedefine ([A-Z0-9_-]+)", r"#define \1", fin.read()))
if nrfxlib_mapping: intersphinx_mapping["nrfxlib"] = nrfxlib_mapping kconfig_mapping = utils.get_intersphinx_mapping("kconfig") if kconfig_mapping: intersphinx_mapping["kconfig"] = kconfig_mapping nrfx_mapping = utils.get_intersphinx_mapping("nrfx") if nrfx_mapping: intersphinx_mapping["nrfx"] = nrfx_mapping # -- Options for doxyrunner plugin --------------------------------------------- doxyrunner_doxygen = os.environ.get("DOXYGEN_EXECUTABLE", "doxygen") doxyrunner_doxyfile = NRF_BASE / "doc" / "nrf" / "nrf.doxyfile.in" doxyrunner_outdir = utils.get_builddir() / "nrf" / "doxygen" doxyrunner_fmt = True doxyrunner_fmt_vars = { "NRF_BASE": str(NRF_BASE), "NRF_BINARY_DIR": str(utils.get_builddir() / "nrf"), } # Options for breathe ---------------------------------------------------------- breathe_projects = {"nrf": str(doxyrunner_outdir / "xml")} breathe_default_project = "nrf" breathe_domain_by_extension = {"h": "c", "c": "c"} breathe_separate_member_pages = True # Options for ncs_include ------------------------------------------------------
import sys import os from pathlib import Path from sphinx.config import eval_config_file # Paths ------------------------------------------------------------------------ BRIDLE_BASE = Path(__file__).absolute().parents[2] # Add the '_extensions' directory to sys.path, to enable finding Bridle's # utilities for Sphinx configuration within. sys.path.insert(0, os.path.join(BRIDLE_BASE, 'doc', '_utils')) import utils ZEPHYR_BASE = utils.get_projdir('zephyr') BRIDLE_ZEPHYR_BUILD = os.path.join(utils.get_builddir(), 'zephyr') # Add the '_extensions' directory to sys.path, to enable finding Bridle's # Sphinx extensions within. sys.path.insert(0, os.path.join(BRIDLE_BASE, 'doc', '_extensions')) # pylint: disable=undefined-variable # General ---------------------------------------------------------------------- # Import all Zephyr configuration, override as needed later conf = eval_config_file(os.path.join(ZEPHYR_BASE, 'doc', 'conf.py'), tags) locals().update(conf) # If your documentation needs a minimal Sphinx version, state it here. needs_sphinx = '3.3'
import sys import os from pathlib import Path # Paths ------------------------------------------------------------------------ BRIDLE_BASE = Path(__file__).absolute().parents[2] # Add the '_extensions' directory to sys.path, to enable finding Bridle's # utilities for Sphinx configuration within. sys.path.insert(0, os.path.join(BRIDLE_BASE, 'doc', '_utils')) import utils ZEPHYR_BASE = utils.get_projdir('zephyr') BRIDLE_BUILD = os.path.join(utils.get_builddir(), 'bridle') # Add the '_extensions' directory to sys.path, to enable finding Bridle's # Sphinx extensions within. sys.path.insert(0, os.path.join(BRIDLE_BASE, 'doc', '_extensions')) # Add the 'extensions' directory to sys.path, to enable finding Zephyr's # Sphinx extensions within. sys.path.insert(0, os.path.join(ZEPHYR_BASE, 'doc', '_extensions')) # Project ---------------------------------------------------------------------- # General information about the project. project = u'Bridle' copyright = u'2019-2022 TiaC Systems members and individual contributors' author = u'TiaC Systems'