xref: /honee/conf.py (revision efbf6ca351c911bc7f6bd5b227ec90c9307a3d2c)
1965d9f74SJames Wright#!/usr/bin/env python3
2965d9f74SJames Wright# -*- coding: utf-8 -*-
3965d9f74SJames Wright#
4965d9f74SJames Wright# HONEE documentation build configuration file
5965d9f74SJames Wright#
6965d9f74SJames Wright# This file is execfile()d with the current directory set to its
7965d9f74SJames Wright# containing dir.
8965d9f74SJames Wright#
9965d9f74SJames Wright# Note that not all possible configuration values are present in this
10965d9f74SJames Wright# autogenerated file.
11965d9f74SJames Wright#
12965d9f74SJames Wright# All configuration values have a default; values that are commented out
13965d9f74SJames Wright# serve to show the default.
14965d9f74SJames Wright
15965d9f74SJames Wright# If extensions (or modules to document with autodoc) are in another directory,
16965d9f74SJames Wright# add these directories to sys.path here. If the directory is relative to the
17965d9f74SJames Wright# documentation root, use os.path.abspath to make it absolute, like shown here.
18965d9f74SJames Wright#
19965d9f74SJames Wright# import os
20965d9f74SJames Wright# import sys
21965d9f74SJames Wright# sys.path.insert(0, os.path.abspath('.'))
22965d9f74SJames Wrightimport glob
23965d9f74SJames Wrightimport shutil
24965d9f74SJames Wrightimport sys
25965d9f74SJames Wrightimport breathe
26965d9f74SJames Wrightimport os
27965d9f74SJames Wrightfrom pathlib import Path
28965d9f74SJames Wrightimport subprocess
29965d9f74SJames Wrightfrom sphinxcontrib import katex
30965d9f74SJames Wright
31965d9f74SJames Wright# -- General configuration ------------------------------------------------
32965d9f74SJames Wright
33965d9f74SJames Wright# If your documentation needs a minimal Sphinx version, state it here.
34965d9f74SJames Wright#
35965d9f74SJames Wright# needs_sphinx = '1.0'
36965d9f74SJames Wright
37965d9f74SJames Wright# Add any Sphinx extension module names here, as strings. They can be
38965d9f74SJames Wright# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39965d9f74SJames Wright# ones.
40965d9f74SJames Wrightextensions = [
41965d9f74SJames Wright    'sphinxext_altair.altairplot',
42965d9f74SJames Wright    'breathe',
43965d9f74SJames Wright    'hoverxref.extension',
44965d9f74SJames Wright    'sphinx_design',
45965d9f74SJames Wright    'myst_parser',
46965d9f74SJames Wright    'sphinx.ext.autodoc',
47965d9f74SJames Wright    'sphinx.ext.coverage',
48965d9f74SJames Wright    'sphinx.ext.doctest',
49965d9f74SJames Wright    'sphinx.ext.ifconfig',
50965d9f74SJames Wright    'sphinx.ext.intersphinx',
51965d9f74SJames Wright    'sphinx.ext.githubpages',
52965d9f74SJames Wright    'sphinxcontrib.katex',
53965d9f74SJames Wright    'sphinxcontrib.mermaid',  # still in beta; fails with latexpdf builder
54965d9f74SJames Wright    'sphinx.ext.todo',
55965d9f74SJames Wright    'sphinx.ext.viewcode',
56965d9f74SJames Wright    'sphinxcontrib.bibtex',
57965d9f74SJames Wright    'sphinxcontrib.rsvgconverter',
58965d9f74SJames Wright]
59965d9f74SJames Wright
60965d9f74SJames Wright# The following, if true, allows figures, tables and code-blocks to be
61965d9f74SJames Wright# automatically numbered if they have a caption.
62965d9f74SJames Wrightnumfig = True
63965d9f74SJames Wright
64965d9f74SJames Wright# Add any paths that contain templates here, relative to this directory.
65965d9f74SJames Wright# templates_path = ['_templates']
66965d9f74SJames Wright
67965d9f74SJames Wright# The master toctree document.
68965d9f74SJames Wrightmaster_doc = 'index'
69965d9f74SJames Wright
70965d9f74SJames Wright# General information about the project.
71965d9f74SJames Wrightproject = 'HONEE'
72965d9f74SJames Wrightcopyright = '2024, University of Colorado, LLNS, and other authors'
73*efbf6ca3SJames Wrightwith open(Path('AUTHORS')) as f:
74*efbf6ca3SJames Wright    authorlist = f.readlines()
75*efbf6ca3SJames Wrightauthor = ', '.join(authorlist)
76965d9f74SJames Wright
77965d9f74SJames Wright# # The version info for the project you're documenting, acts as replacement for
78965d9f74SJames Wright# # |version| and |release|, also used in various other places throughout the
79965d9f74SJames Wright# # built documents.
80965d9f74SJames Wright# #
81965d9f74SJames Wright# # The short X.Y version.
82965d9f74SJames Wright# with open(Path('ratel.pc.template')) as f:
83965d9f74SJames Wright#     pkgconf_version = 'unknown'
84965d9f74SJames Wright#     for line in f:
85965d9f74SJames Wright#         if line.startswith('Version:'):
86965d9f74SJames Wright#             pkgconf_version = line.partition(': ')[2]
87965d9f74SJames Wright#             break
88965d9f74SJames Wright# version = pkgconf_version
89965d9f74SJames Wright# # The full version, including alpha/beta/rc tags.
90965d9f74SJames Wright# release = pkgconf_version
91965d9f74SJames Wright
92965d9f74SJames Wright# The language for content autogenerated by Sphinx. Refer to documentation
93965d9f74SJames Wright# for a list of supported languages.
94965d9f74SJames Wright#
95965d9f74SJames Wright# This is also used if you do content translation via gettext catalogs.
96965d9f74SJames Wright# Usually you set "language" from the command line for these cases.
97965d9f74SJames Wrightlanguage = 'en'
98965d9f74SJames Wright
99965d9f74SJames Wright# List of patterns, relative to source directory, that match files and
100965d9f74SJames Wright# directories to ignore when looking for source files.
101965d9f74SJames Wright# This patterns also effect to html_static_path and html_extra_path
102965d9f74SJames Wrightexclude_patterns = [
103965d9f74SJames Wright    '.gitlab',
104965d9f74SJames Wright    'VENV*',
105965d9f74SJames Wright    'tests/junit-xml/*',
106965d9f74SJames Wright    'tests/README.md',
107965d9f74SJames Wright    'tests/createPyTorchModel/README.md',
108965d9f74SJames Wright    'RELEASING.md',
109965d9f74SJames Wright]
110965d9f74SJames Wright
111965d9f74SJames Wright# The name of the Pygments (syntax highlighting) style to use.
112965d9f74SJames Wrightpygments_style = 'sphinx'
113965d9f74SJames Wright
114965d9f74SJames Wright# If true, `todo` and `todoList` produce output, else they produce nothing.
115965d9f74SJames Wrighttodo_include_todos = True
116965d9f74SJames Wright
117965d9f74SJames Wright# sphinxcontrib-bibtex 2.0 requires listing all bibtex files here
118965d9f74SJames Wrightbibtex_bibfiles = ['doc/references.bib']
119965d9f74SJames Wright
120965d9f74SJames Wrightmyst_enable_extensions = [
121965d9f74SJames Wright    'deflist',
122965d9f74SJames Wright    'dollarmath',
123965d9f74SJames Wright    'html_image',
124965d9f74SJames Wright    'linkify',
125965d9f74SJames Wright    'colon_fence',
126965d9f74SJames Wright]
127965d9f74SJames Wright
128965d9f74SJames Wrightmyst_heading_anchors = 2
129965d9f74SJames Wright# Note: The config value `myst_url_schemes' defaults to type `list'
130965d9f74SJames Wrightmyst_url_schemes = ['http', 'https', 'mailto']
131965d9f74SJames Wright
132965d9f74SJames Wright# -- Options for HTML output ----------------------------------------------
133965d9f74SJames Wright
134965d9f74SJames Wright# The theme to use for HTML and HTML Help pages.  See the documentation for
135965d9f74SJames Wright# a list of builtin themes.
136965d9f74SJames Wrighthtml_theme = 'furo'
137965d9f74SJames Wright
138965d9f74SJames Wright# Project logo
139965d9f74SJames Wright# html_logo = 'doc/img/logo.png'
140965d9f74SJames Wright
141965d9f74SJames Wright# Project favicon
142965d9f74SJames Wright# html_favicon = 'doc/img/logo.ico'
143965d9f74SJames Wright
144965d9f74SJames Wright# Theme options are theme-specific and customize the look and feel of a theme
145965d9f74SJames Wright# further.  For a list of options available for each theme, see the
146965d9f74SJames Wright# documentation.
147965d9f74SJames Wright#
148965d9f74SJames Wright# html_theme_options = {}
149965d9f74SJames Wright
150965d9f74SJames Wright# Add any paths that contain custom static files (such as style sheets) here,
151965d9f74SJames Wright# relative to this directory. They are copied after the builtin static files,
152965d9f74SJames Wright# so a file named "default.css" will overwrite the builtin "default.css".
153965d9f74SJames Wrighthtml_static_path = ['doc/css']
154965d9f74SJames Wright
155965d9f74SJames Wright# hoverxref options
156965d9f74SJames Wrighthoverxref_auto_ref = True
157965d9f74SJames Wrighthoverxref_mathjax = True
158965d9f74SJames Wrighthoverxref_role_types = {
159965d9f74SJames Wright    'ref': 'modal',
160965d9f74SJames Wright}
161965d9f74SJames Wright
162965d9f74SJames Wrightlatex_macros = r"""
163965d9f74SJames Wright\def \diff {\operatorname{d}\!}
164965d9f74SJames Wright\def \tcolon {\!:\!}
165965d9f74SJames Wright\def \trace {\operatorname{trace}}
166965d9f74SJames Wright\def \sign {\operatorname{sign}}
167965d9f74SJames Wright"""
168965d9f74SJames Wright
169965d9f74SJames Wright# Translate LaTeX macros to KaTeX and add to options for HTML builder
170965d9f74SJames Wrightkatex_macros = katex.latex_defs_to_katex_macros(latex_macros)
171965d9f74SJames Wrightkatex_options = 'macros: {' + katex_macros + '}'
172965d9f74SJames Wright
173965d9f74SJames Wright# -- Options for HTMLHelp output ------------------------------------------
174965d9f74SJames Wright
175965d9f74SJames Wright# Output file base name for HTML help builder.
176965d9f74SJames Wrighthtmlhelp_basename = 'HONEEdoc'
177965d9f74SJames Wright
178965d9f74SJames Wright
179965d9f74SJames Wright# -- Options for LaTeX output ---------------------------------------------
180965d9f74SJames Wright
181965d9f74SJames Wrightlatex_engine = 'lualatex'
182965d9f74SJames Wright
183965d9f74SJames Wrightlatex_elements = {
184965d9f74SJames Wright    # The paper size ('letterpaper' or 'a4paper').
185965d9f74SJames Wright    #
186965d9f74SJames Wright    # 'papersize': 'letterpaper',
187965d9f74SJames Wright
188965d9f74SJames Wright    # The font size ('10pt', '11pt' or '12pt').
189965d9f74SJames Wright    #
190965d9f74SJames Wright    # 'pointsize': '10pt',
191965d9f74SJames Wright
192965d9f74SJames Wright    # Additional stuff for the LaTeX preamble.
193965d9f74SJames Wright    #
194965d9f74SJames Wright    'preamble': r"""
195965d9f74SJames Wright\usepackage{amscd}
196965d9f74SJames Wright\newcommand\bm[1]{\symbf{#1}}
197965d9f74SJames Wright""" + latex_macros,
198965d9f74SJames Wright
199965d9f74SJames Wright    # Latex figure (float) alignment
200965d9f74SJames Wright    #
201965d9f74SJames Wright    # 'figure_align': 'htbp',
202965d9f74SJames Wright    'fontpkg': r"""
203965d9f74SJames Wright\usepackage[math-style=ISO,bold-style=ISO]{unicode-math}
204965d9f74SJames Wright\setmainfont{TeX Gyre Pagella}
205965d9f74SJames Wright\setmathfont{TeX Gyre Pagella Math}
206965d9f74SJames Wright\setsansfont{DejaVu Sans}
207965d9f74SJames Wright\setmonofont{DejaVu Sans Mono}
208965d9f74SJames Wright""",
209965d9f74SJames Wright}
210965d9f74SJames Wright
211965d9f74SJames Wright# latex_logo = 'doc/img/logo.jpg'
212965d9f74SJames Wright
213*efbf6ca3SJames Wrightlatexauthorslist = r' \and '.join(authorlist)
214965d9f74SJames Wright
215965d9f74SJames Wright# Grouping the document tree into LaTeX files. List of tuples
216965d9f74SJames Wright# (source start file, target name, title,
217965d9f74SJames Wright#  author, documentclass [howto, manual, or own class]).
218965d9f74SJames Wrightlatex_documents = [
219965d9f74SJames Wright    (master_doc, 'honee.tex', 'HONEE User Manual', latexauthorslist, 'howto'),
220965d9f74SJames Wright]
221965d9f74SJames Wright
222965d9f74SJames Wright# -- Options for manual page output ---------------------------------------
223965d9f74SJames Wright
224965d9f74SJames Wright# One entry per manual page. List of tuples
225965d9f74SJames Wright# (source start file, name, description, authors, manual section).
226965d9f74SJames Wrightman_pages = [
227965d9f74SJames Wright    (master_doc, 'honee', 'HONEE User Manual', [author], 1)
228965d9f74SJames Wright]
229965d9f74SJames Wright
230965d9f74SJames Wright# -- Options for Texinfo output -------------------------------------------
231965d9f74SJames Wright
232965d9f74SJames Wright# Grouping the document tree into Texinfo files. List of tuples
233965d9f74SJames Wright# (source start file, target name, title, author,
234965d9f74SJames Wright#  dir menu entry, description, category)
235965d9f74SJames Wrighttexinfo_documents = [
236965d9f74SJames Wright    (master_doc, 'honee', 'HONEE User Manual', latexauthorslist, 'HONEE', 'High-Order Navier-stokes Equation Evaluator'),
237965d9f74SJames Wright]
238965d9f74SJames Wright
239965d9f74SJames Wright# -- Options for Epub output ----------------------------------------------
240965d9f74SJames Wright
241965d9f74SJames Wright# Bibliographic Dublin Core info.
242965d9f74SJames Wrightepub_title = project
243965d9f74SJames Wrightepub_author = author
244965d9f74SJames Wrightepub_publisher = author
245965d9f74SJames Wrightepub_copyright = copyright
246965d9f74SJames Wright
247965d9f74SJames Wright# The unique identifier of the text. This can be a ISBN number
248965d9f74SJames Wright# or the project homepage.
249965d9f74SJames Wright#
250965d9f74SJames Wright# epub_identifier = ''
251965d9f74SJames Wright
252965d9f74SJames Wright# A unique identification for the text.
253965d9f74SJames Wright#
254965d9f74SJames Wright# epub_uid = ''
255965d9f74SJames Wright
256965d9f74SJames Wright# A list of files that should not be packed into the epub file.
257965d9f74SJames Wrightepub_exclude_files = ['search.html']
258965d9f74SJames Wright
259965d9f74SJames Wright
260965d9f74SJames Wright# Example configuration for intersphinx: refer to the Python standard library.
261965d9f74SJames Wrightintersphinx_mapping = {
262965d9f74SJames Wright    'python': ('https://docs.python.org/3', None),
263965d9f74SJames Wright    'numpy': ('https://numpy.org/devdocs', None),
264965d9f74SJames Wright}
265965d9f74SJames Wright
266965d9f74SJames Wright
267965d9f74SJames Wright# -- Options for breathe --------------------------------------------------
268965d9f74SJames Wrightbreathe_projects = {'HONEE': 'xml'}
269965d9f74SJames Wrightbreathe_default_project = 'HONEE'
270965d9f74SJames Wrightbreathe_build_directory = 'doc/build/breathe'
271965d9f74SJames Wrightbreathe_domain_by_extension = {'c': 'c', 'h': 'c', 'cpp': 'cpp', 'hpp': 'cpp'}
272965d9f74SJames Wrightbreathe_show_define_initializer = True
273