blob: 7efc1dbedc289744a5a358090cec5d79368dc3bd [file] [log] [blame]
Gyorgy Szing74dae3c2018-09-27 17:00:46 +02001# -*- coding: utf-8 -*-
2#-------------------------------------------------------------------------------
Summer Qin0c20bcc2021-05-10 11:03:04 +08003# Copyright (c) 2019-2021, Arm Limited. All rights reserved.
Gyorgy Szing74dae3c2018-09-27 17:00:46 +02004#
5# SPDX-License-Identifier: BSD-3-Clause
6#
7#-------------------------------------------------------------------------------#
8
9# Configuration file for the Sphinx documentation builder.
10#
11# This file does only contain a selection of the most common options. For a
12# full list see the documentation:
13# http://www.sphinx-doc.org/en/master/config
14
15# -- Path setup --------------------------------------------------------------
16
17# If extensions (or modules to document with autodoc) are in another directory,
18# add these directories to sys.path here. If the directory is relative to the
19# documentation root, use os.path.abspath to make it absolute, like shown here.
20#
21import os
22import sys
23sys.path.insert(0, os.path.abspath('..'))
24sys.path.insert(0, os.path.abspath('../docs'))
25
26# -- Project information -----------------------------------------------------
27
Galanakis, Minos35fc4472019-10-01 15:19:52 +010028project = 'Trusted Firmware-M'
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020029copyright = '2017-2019, ARM CE-OSS'
30author = 'ARM CE-OSS'
Galanakis, Minos35fc4472019-10-01 15:19:52 +010031title = 'User Guide'
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020032
33# The short X.Y version
34version = '@SPHINXCFG_TFM_VERSION@'
35# The full version, including alpha/beta/rc tags
36release = '@SPHINXCFG_TFM_VERSION_FULL@'
37
38
39# -- General configuration ---------------------------------------------------
40
41# If your documentation needs a minimal Sphinx version, state it here.
42#
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020043# needs_sphinx = '1.4'
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020044
45# Add any Sphinx extension module names here, as strings. They can be
46# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
47# ones.
48extensions = [
49 'sphinx.ext.imgmath',
Anton Komlev27a52c22021-10-16 02:04:09 +010050 'm2r2', #Support markdown files. Needed for external code.
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020051 'sphinx.ext.autosectionlabel', #Make sphinx generate a label for each section
Summer Qine99f95f2021-04-25 11:28:39 +080052 'sphinxcontrib.plantuml', #Add support for PlantUML drawings
Summer Qin0c20bcc2021-05-10 11:03:04 +080053 'sphinxcontrib.rsvgconverter', #Add support for SVG to PDF
54 'sphinx_tabs.tabs' #Enable tab extension in Sphinx
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020055]
56
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020057#Location of PlantUML
58plantuml = '@Java_JAVA_EXECUTABLE@ -jar @PLANTUML_JAR_PATH@'
59
60#Make auso section labals generated be prefixed with file name.
61autosectionlabel_prefix_document=True
Galanakis, Minosf56baf62019-11-11 13:57:42 +000062#Add auso section label for level 2 headers only.
63autosectionlabel_maxdepth=2
Gyorgy Szingdb9783c2019-04-17 21:08:48 +020064
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020065# Add any paths that contain templates here, relative to this directory.
66templates_path = ['_templates']
67
68# The suffix(es) of source filenames.
69# You can specify multiple suffix as a list of string:
70#
71source_suffix = ['.rst', '.md']
72
73# The master toctree document.
74master_doc = 'index'
75
76# The language for content autogenerated by Sphinx. Refer to documentation
77# for a list of supported languages.
78#
79# This is also used if you do content translation via gettext catalogs.
80# Usually you set "language" from the command line for these cases.
81language = None
82
83# List of patterns, relative to source directory, that match files and
84# directories to ignore when looking for source files.
85# This pattern also affects html_static_path and html_extra_path .
Galanakis, Minosdc6694b2020-01-06 13:54:56 +000086exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'readme.rst',
Minos Galanakis56cb7592020-02-10 10:40:12 +000087 'platform/ext/target/cypress/psoc64/security/keys/readme.rst',
88 'lib/ext/**']
Gyorgy Szing74dae3c2018-09-27 17:00:46 +020089
90# The name of the Pygments (syntax highlighting) style to use.
91pygments_style = 'sphinx'
92
93
94# -- Options for HTML output -------------------------------------------------
95
96# The theme to use for HTML and HTML Help pages. See the documentation for
97# a list of builtin themes.
98#
99html_theme = 'sphinx_rtd_theme'
100
101# Theme options are theme-specific and customize the look and feel of a theme
102# further. For a list of options available for each theme, see the
103# documentation.
104#
Galanakis, Minos35fc4472019-10-01 15:19:52 +0100105html_theme_options = {'collapse_navigation': False}
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200106#
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200107# Add any paths that contain custom static files (such as style sheets) here,
108# relative to this directory. They are copied after the builtin static files,
109# so a file named "default.css" will overwrite the builtin "default.css".
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200110html_static_path = ['@TFM_ROOT_DIR@/docs/_static']
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200111
Galanakis, Minos35fc4472019-10-01 15:19:52 +0100112# Set the documentation logo
113html_logo = '@TFM_ROOT_DIR@/docs/_static/images/tf_logo_white.png'
114
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200115# Custom sidebar templates, must be a dictionary that maps document names
116# to template names.
117#
118# The default sidebars (for documents that don't match any pattern) are
119# defined by theme itself. Builtin themes are using these templates by
120# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
121# 'searchbox.html']``.
122#
123# html_sidebars = {}
124
125#Disable adding conf.py copyright notice to HTML output
126html_show_copyright = False
127
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200128#Add custom css for HTML. Used to allow full page width rendering
129def setup(app):
Anton Komlev27a52c22021-10-16 02:04:09 +0100130 app.add_css_file('css/tfm_custom.css')
Gyorgy Szingdb9783c2019-04-17 21:08:48 +0200131
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200132# -- Options for HTMLHelp output ---------------------------------------------
133
134# Output file base name for HTML help builder.
135htmlhelp_basename = 'TF-M doc'
136
Galanakis, Minosdc6694b2020-01-06 13:54:56 +0000137rst_prolog = """
138.. |TFM_VERSION| replace:: @SPHINXCFG_TFM_VERSION@
139"""
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200140
Ken Liu40510162021-05-06 17:38:49 +0800141# Enable figures and tables auto numbering
142numfig = True
143numfig_secnum_depth = 0
144numfig_format = {
145 'figure': 'Figure %s:',
146 'table': 'Table %s:',
147 'code-block': 'Listing %s:',
148 'section': '%s'
149}
150
Gyorgy Szing74dae3c2018-09-27 17:00:46 +0200151# -- Options for LaTeX output ------------------------------------------------
152
153latex_elements = {
154 # The paper size ('letterpaper' or 'a4paper').
155 #
156 # 'papersize': 'letterpaper',
157
158 # The font size ('10pt', '11pt' or '12pt').
159 #
160 # 'pointsize': '10pt',
161
162 # Additional stuff for the LaTeX preamble.
163 #
164 # 'preamble': '',
165
166 # Latex figure (float) alignment
167 #
168 # 'figure_align': 'htbp',
169}
170
171# Grouping the document tree into LaTeX files. List of tuples
172# (source start file, target name, title,
173# author, documentclass [howto, manual, or own class]).
174latex_documents = [
175 (master_doc, 'TF-M.tex', title,
176 author, 'manual'),
177]
178
179
180# -- Options for manual page output ------------------------------------------
181
182# One entry per manual page. List of tuples
183# (source start file, name, description, authors, manual section).
184#man_pages = [
185# (master_doc, 'tf-m', title,
186# [author], 7)
187#]
188
189
190# -- Options for Texinfo output ----------------------------------------------
191
192# Grouping the document tree into Texinfo files. List of tuples
193# (source start file, target name, title, author,
194# dir menu entry, description, category)
195#texinfo_documents = [
196# (master_doc, 'TF-M', title,
197# author, 'TF-M', 'Trusted Firmware for Cortex-M',
198# 'Miscellaneous'),
199#]
200
201
202# -- Extension configuration -------------------------------------------------