1# -*- coding: utf-8 -*- 2 3# -- Metadata about this file ------------------------------------------------ 4__copyright__ = "Copyright (c) 2020-2023 Arm Limited and Contributors." 5__license__ = "SPDX-License-Identifier: BSD-3-Clause" 6 7# Configuration file for the Sphinx documentation builder. 8 9# -- Path setup -------------------------------------------------------------- 10 11# If extensions (or modules to document with autodoc) are in another directory, 12# add these directories to sys.path here. If the directory is relative to the 13# documentation root, use os.path.abspath to make it absolute, like shown here. 14# 15import os 16# import sys 17# sys.path.insert(0, os.path.abspath('.')) 18 19# -- Project information ----------------------------------------------------- 20project = 'Trusted Services' 21 22# The full version, including alpha/beta/rc tags 23with open('../version.txt', 'r') as f: 24 release = f.read() 25 f.close() 26version=release 27 28# -- General configuration --------------------------------------------------- 29 30# Add any Sphinx extension module names here, as strings. They can be 31# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 32# ones. 33extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.plantuml', 34 'sphinxcontrib.moderncmakedomain' ] 35 36# Add any paths that contain templates here, relative to this directory. 37templates_path = ['_templates'] 38 39# The suffix(es) of source filenames. 40source_suffix = '.rst' 41 42# The master toctree document. 43master_doc = 'index' 44 45# The language for content autogenerated by Sphinx. Refer to documentation 46# for a list of supported languages. 47# 48# This is also used if you do content translation via gettext catalogs. 49# Usually you set "language" from the command line for these cases. 50language = 'en' 51 52# List of patterns, relative to source directory, that match files and 53# directories to ignore when looking for source files. 54# This pattern also affects html_static_path and html_extra_path. 55exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] 56 57# The name of the Pygments (syntax highlighting) style to use. 58pygments_style = 'sphinx' 59 60# Load the contents of the global substitutions file into the 'rst_prolog' 61# variable. This ensures that the substitutions are all inserted into each page. 62with open('global_substitutions.txt', 'r') as subs: 63 rst_prolog = subs.read() 64# Minimum version of sphinx required 65needs_sphinx = '2.0' 66 67# -- Options for HTML output ------------------------------------------------- 68 69# Don't show the "Built with Sphinx" footer 70html_show_sphinx = False 71 72# Don't show copyright info in the footer (we have this content in the page) 73html_show_copyright = False 74 75# The theme to use for HTML and HTML Help pages. See the documentation for 76# a list of builtin themes. 77html_theme = "sphinx_rtd_theme" 78 79# The logo to display in the sidebar 80html_logo = '_static/images/tf_logo_white.png' 81 82 83# Options for the "sphinx-rtd-theme" theme 84html_theme_options = { 85 'collapse_navigation': False, # Can expand and collapse sidebar entries 86 'prev_next_buttons_location': 'both', # Top and bottom of the page 87 'style_external_links': True # Display an icon next to external links 88} 89 90html_static_path = ['_static'] 91 92#Add custom css for HTML. Used to allow full page width rendering 93def setup(app): 94 app.add_css_file('css/custom.css') 95 96 97# -- Options for autosectionlabel -------------------------------------------- 98 99# Only generate automatic section labels for document titles 100autosectionlabel_maxdepth = 1 101 102# -- Options for plantuml ---------------------------------------------------- 103 104plantuml_output_format = 'svg_img' 105 106# if plantuml wrapper executable is specified use it. 107_p=os.environ.get('PLANTUML') 108if _p is None: 109 # if a specific jar file is specified use it with an "inline" wrapper 110 jar=os.environ.get('PLANTUML_JAR_PATH') 111 if jar is not None: 112 # if JAVA_HOME look for the JVM under that location 113 java_home=os.environ.get('JAVA_HOME') 114 if java_home is not None: 115 java=os.path.join(java_home, "bin", "java") 116 else: 117 # if not, look for JVM on the PATH 118 import shutil 119 java=shutil.which("java") 120 # if the JVM does not exist, fall back to java 121 if not os.path.exists(java): 122 java='java' 123 # Set the wrapper command 124 _p="%s -Djava.awt.headless=true -Djava.net.useSystemProxies=true -jar %s" % (java, jar) 125 126# if a plantuml executable was discovered, use that, or leave the default value 127# unchanged 128if _p is not None: 129 plantuml=_p