Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 1 | # -*- 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 | |
| 9 | import os |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 10 | import re |
| 11 | from subprocess import check_output |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 12 | |
| 13 | # -- Project information ----------------------------------------------------- |
| 14 | |
| 15 | project = 'Realm Management Monitor' |
| 16 | copyright = 'TF-RMM Contributors' |
| 17 | author = 'TF-RMM Contributors' |
| 18 | title = 'User Guide' |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 19 | |
| 20 | try: |
Arunachalam Ganapathy | bacc0de | 2022-11-21 14:21:10 +0000 | [diff] [blame^] | 21 | vregx = re.compile(r'(?P<RMM_VERSION>v.+?)' |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 22 | 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 Ganapathy | bacc0de | 2022-11-21 14:21:10 +0000 | [diff] [blame^] | 26 | version = _v.group('RMM_VERSION') |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 27 | if _v.group('GIT_SHA'): |
Arunachalam Ganapathy | bacc0de | 2022-11-21 14:21:10 +0000 | [diff] [blame^] | 28 | version += "+" + _v.group('GIT_SHA')[:7] |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 29 | except: |
| 30 | version = 'Unknown' |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 31 | |
| 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. |
| 37 | extensions = ['sphinx.ext.autosectionlabel', 'sphinxcontrib.plantuml'] |
| 38 | |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 39 | # Add any paths that contain templates here, relative to this directory. |
| 40 | templates_path = ['_templates'] |
| 41 | |
| 42 | # The suffix(es) of source filenames. |
| 43 | source_suffix = ['.rst'] |
| 44 | |
| 45 | # The master toctree document. |
| 46 | master_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. |
| 53 | language = 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 . |
| 58 | exclude_patterns = [] |
| 59 | |
| 60 | # The name of the Pygments (syntax highlighting) style to use. |
| 61 | pygments_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 Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 65 | with open('global_substitutions.txt', 'r') as subs: |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 66 | rst_prolog = subs.read() |
| 67 | |
| 68 | # Minimum version of sphinx required |
| 69 | needs_sphinx = '2.4' |
| 70 | |
| 71 | # -- Options for HTML output ------------------------------------------------- |
| 72 | |
| 73 | # Don't show the "Built with Sphinx" footer |
| 74 | html_show_sphinx = False |
| 75 | |
| 76 | # Show copyright info in the footer |
| 77 | html_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. |
| 81 | html_theme = "sphinx_rtd_theme" |
| 82 | |
| 83 | # The logo to display in the sidebar |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 84 | html_logo = '_static/images/TrustedFirmware-Logo_standard-white.png' |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 85 | |
| 86 | # Options for the "sphinx-rtd-theme" theme |
| 87 | html_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 Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 94 | html_static_path = ['_static'] |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 95 | |
| 96 | # Path to css file relative to html_static_path |
Arunachalam Ganapathy | f1a13aa | 2022-11-11 15:07:12 +0000 | [diff] [blame] | 97 | html_css_files = ['css/rmm_custom.css',] |
Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 98 | |
| 99 | # -- Options for autosectionlabel -------------------------------------------- |
| 100 | |
| 101 | # Only generate automatic section labels for document titles |
| 102 | autosectionlabel_maxdepth = 1 |
| 103 | |
| 104 | # -- Options for plantuml ---------------------------------------------------- |
| 105 | |
| 106 | plantuml_output_format = 'svg_img' |