blob: f34fa81864ee9123e119c0d27e7ad3d062806019 [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.
37extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.plantuml']
38
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
48# The language for content autogenerated by Sphinx. Refer to documentation
49# for a list of supported languages.
50#
51# This is also used if you do content translation via gettext catalogs.
52# Usually you set "language" from the command line for these cases.
53language = None
54
55# List of patterns, relative to source directory, that match files and
56# directories to ignore when looking for source files.
57# This pattern also affects html_static_path and html_extra_path .
58exclude_patterns = []
59
60# The name of the Pygments (syntax highlighting) style to use.
61pygments_style = 'sphinx'
62
63# Load the contents of the global substitutions file into the 'rst_prolog'
64# variable. This ensures that the substitutions are all inserted into each page.
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000065with open('global_substitutions.txt', 'r') as subs:
Soby Mathewb4c6df42022-11-09 11:13:29 +000066 rst_prolog = subs.read()
67
68# Minimum version of sphinx required
69needs_sphinx = '2.4'
70
71# -- Options for HTML output -------------------------------------------------
72
73# Don't show the "Built with Sphinx" footer
74html_show_sphinx = False
75
76# Show copyright info in the footer
77html_show_copyright = True
78
79# The theme to use for HTML and HTML Help pages. See the documentation for
80# a list of builtin themes.
81html_theme = "sphinx_rtd_theme"
82
83# The logo to display in the sidebar
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000084html_logo = '_static/images/TrustedFirmware-Logo_standard-white.png'
Soby Mathewb4c6df42022-11-09 11:13:29 +000085
86# Options for the "sphinx-rtd-theme" theme
87html_theme_options = {
88 'collapse_navigation': False, # Can expand and collapse sidebar entries
89 'prev_next_buttons_location': 'both', # Top and bottom of the page
90 'style_external_links': True # Display an icon next to external links
91}
92
93# Path to _static directory
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000094html_static_path = ['_static']
Soby Mathewb4c6df42022-11-09 11:13:29 +000095
96# Path to css file relative to html_static_path
Arunachalam Ganapathyf1a13aa2022-11-11 15:07:12 +000097html_css_files = ['css/rmm_custom.css',]
Soby Mathewb4c6df42022-11-09 11:13:29 +000098
99# -- Options for autosectionlabel --------------------------------------------
100
101# Only generate automatic section labels for document titles
102autosectionlabel_maxdepth = 1
103
104# -- Options for plantuml ----------------------------------------------------
105
106plantuml_output_format = 'svg_img'