blob: f97f4768024be1c90a7aecd966c5d90277c99c57 [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001# -*- coding: utf-8 -*-
2# SPDX-License-Identifier: BSD-3-Clause
3# SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4#
5# Configuration file for the Sphinx documentation builder.
6#
7# See the options documentation at http://www.sphinx-doc.org/en/master/config
8
9import os
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000010import re
11from subprocess import check_output
Soby Mathewb4c6df42022-11-09 11:13:29 +000012
13# -- Project information -----------------------------------------------------
14
15project = 'Realm Management Monitor'
16copyright = 'TF-RMM Contributors'
17author = 'TF-RMM Contributors'
18title = 'User Guide'
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000019
20try:
Arunachalam Ganapathy484843f2022-11-30 14:39:45 +000021 vregx = re.compile(r'tf-rmm-(?P<RMM_VERSION>v.+?)'
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000022 r'(-[0-9]+-)?(?P<GIT_SHA>g[a-f0-9]{7,})?$')
23 git_result = check_output("git describe --tags --always",
24 shell = True, encoding = 'UTF-8')
25 _v = vregx.match(git_result)
Arunachalam Ganapathybacc0de2022-11-21 14:21:10 +000026 version = _v.group('RMM_VERSION')
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000027 if _v.group('GIT_SHA'):
Arunachalam Ganapathybacc0de2022-11-21 14:21:10 +000028 version += "+" + _v.group('GIT_SHA')[:7]
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000029except:
30 version = 'Unknown'
Soby Mathewb4c6df42022-11-09 11:13:29 +000031
32# -- General configuration ---------------------------------------------------
33
34# Add any Sphinx extension module names here, as strings. They can be
35# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
36# ones.
Arunachalam Ganapathy84586ff2024-01-23 10:19:52 +000037extensions = ['sphinx.ext.autosectionlabel']
Soby Mathewb4c6df42022-11-09 11:13:29 +000038
Soby Mathewb4c6df42022-11-09 11:13:29 +000039# Add any paths that contain templates here, relative to this directory.
40templates_path = ['_templates']
41
42# The suffix(es) of source filenames.
43source_suffix = ['.rst']
44
45# The master toctree document.
46master_doc = 'index'
47
Soby Mathewb4c6df42022-11-09 11:13:29 +000048# List of patterns, relative to source directory, that match files and
49# directories to ignore when looking for source files.
50# This pattern also affects html_static_path and html_extra_path .
51exclude_patterns = []
52
53# The name of the Pygments (syntax highlighting) style to use.
54pygments_style = 'sphinx'
55
56# Load the contents of the global substitutions file into the 'rst_prolog'
57# variable. This ensures that the substitutions are all inserted into each page.
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000058with open('global_substitutions.txt', 'r') as subs:
Soby Mathewb4c6df42022-11-09 11:13:29 +000059 rst_prolog = subs.read()
60
61# Minimum version of sphinx required
Arunachalam Ganapathy84586ff2024-01-23 10:19:52 +000062needs_sphinx = '5.3.0'
Soby Mathewb4c6df42022-11-09 11:13:29 +000063
64# -- Options for HTML output -------------------------------------------------
65
66# Don't show the "Built with Sphinx" footer
67html_show_sphinx = False
68
69# Show copyright info in the footer
70html_show_copyright = True
71
72# The theme to use for HTML and HTML Help pages. See the documentation for
73# a list of builtin themes.
74html_theme = "sphinx_rtd_theme"
75
76# The logo to display in the sidebar
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000077html_logo = '_static/images/TrustedFirmware-Logo_standard-white.png'
Soby Mathewb4c6df42022-11-09 11:13:29 +000078
79# Options for the "sphinx-rtd-theme" theme
80html_theme_options = {
81 'collapse_navigation': False, # Can expand and collapse sidebar entries
82 'prev_next_buttons_location': 'both', # Top and bottom of the page
83 'style_external_links': True # Display an icon next to external links
84}
85
86# Path to _static directory
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000087html_static_path = ['_static']
Soby Mathewb4c6df42022-11-09 11:13:29 +000088
89# Path to css file relative to html_static_path
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000090html_css_files = ['css/rmm_custom.css',]
Soby Mathewb4c6df42022-11-09 11:13:29 +000091
92# -- Options for autosectionlabel --------------------------------------------
93
94# Only generate automatic section labels for document titles
95autosectionlabel_maxdepth = 1
96
97# -- Options for plantuml ----------------------------------------------------
98
99plantuml_output_format = 'svg_img'