blob: a2f36224c5a6ceece88f85291f4f57b9798f39b2 [file] [log] [blame]
Davide Pesaventoec61b742020-04-18 01:00:12 -04001# Configuration file for the Sphinx documentation builder.
2#
Davide Pesavento344e75c2022-09-19 23:14:31 -04003# For the full list of built-in configuration values, see the documentation:
Davide Pesavento3c7f6452021-10-02 04:06:26 -04004# https://www.sphinx-doc.org/en/master/usage/configuration.html
Davide Pesaventoec61b742020-04-18 01:00:12 -04005
Davide Pesavento344e75c2022-09-19 23:14:31 -04006import importlib.util
Davide Pesaventoec61b742020-04-18 01:00:12 -04007import sys
Davide Pesaventoec61b742020-04-18 01:00:12 -04008
9# -- Project information -----------------------------------------------------
Davide Pesavento344e75c2022-09-19 23:14:31 -040010# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Davide Pesaventoec61b742020-04-18 01:00:12 -040011
Davide Pesavento344e75c2022-09-19 23:14:31 -040012project = 'NAC: Name-based Access Control library'
Davide Pesaventod64a9d12023-01-01 16:30:03 -050013copyright = 'Copyright © 2014-2023 Regents of the University of California.'
Davide Pesavento344e75c2022-09-19 23:14:31 -040014author = 'Named Data Networking Project'
Davide Pesaventoec61b742020-04-18 01:00:12 -040015
Davide Pesavento3c7f6452021-10-02 04:06:26 -040016# The short X.Y version.
Davide Pesaventoec61b742020-04-18 01:00:12 -040017#version = ''
18
Davide Pesavento3c7f6452021-10-02 04:06:26 -040019# The full version, including alpha/beta/rc tags.
Davide Pesaventoec61b742020-04-18 01:00:12 -040020#release = ''
21
22# There are two options for replacing |today|: either, you set today to some
23# non-false value, then it is used:
24#today = ''
25# Else, today_fmt is used as the format for a strftime call.
26today_fmt = '%Y-%m-%d'
27
28
29# -- General configuration ---------------------------------------------------
Davide Pesavento344e75c2022-09-19 23:14:31 -040030# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040031
Davide Pesavento344e75c2022-09-19 23:14:31 -040032needs_sphinx = '4.0'
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040033extensions = [
Davide Pesaventoec61b742020-04-18 01:00:12 -040034 'sphinx.ext.extlinks',
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040035 'sphinx.ext.todo',
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040036]
37
Davide Pesaventoa3665fe2022-09-25 03:16:31 -040038def addExtensionIfExists(extension: str):
39 try:
40 if importlib.util.find_spec(extension) is None:
41 raise ModuleNotFoundError(extension)
42 except (ImportError, ValueError):
Davide Pesavento344e75c2022-09-19 23:14:31 -040043 sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
Davide Pesaventoa3665fe2022-09-25 03:16:31 -040044 'Some documentation may not build correctly.\n')
45 else:
46 extensions.append(extension)
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040047
Davide Pesaventoec61b742020-04-18 01:00:12 -040048addExtensionIfExists('sphinxcontrib.doxylink')
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040049
Davide Pesaventoec61b742020-04-18 01:00:12 -040050templates_path = ['_templates']
Davide Pesavento344e75c2022-09-19 23:14:31 -040051exclude_patterns = ['Thumbs.db', '.DS_Store']
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040052
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040053
Davide Pesaventoec61b742020-04-18 01:00:12 -040054# -- Options for HTML output -------------------------------------------------
Davide Pesavento344e75c2022-09-19 23:14:31 -040055# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040056
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040057html_theme = 'named_data_theme'
Davide Pesaventoec61b742020-04-18 01:00:12 -040058html_theme_path = ['.']
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040059
60# Add any paths that contain custom static files (such as style sheets) here,
61# relative to this directory. They are copied after the builtin static files,
62# so a file named "default.css" will overwrite the builtin "default.css".
63html_static_path = ['_static']
64
Davide Pesavento3c7f6452021-10-02 04:06:26 -040065html_copy_source = False
66html_show_sourcelink = False
67
68# Disable syntax highlighting of code blocks by default.
69highlight_language = 'none'
70
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040071
Davide Pesavento344e75c2022-09-19 23:14:31 -040072# -- Misc options ------------------------------------------------------------
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040073
74doxylink = {
Davide Pesaventoec61b742020-04-18 01:00:12 -040075 'nac': ('nac.tag', 'doxygen/'),
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040076}
77
Davide Pesaventoec61b742020-04-18 01:00:12 -040078extlinks = {
Davide Pesavento344e75c2022-09-19 23:14:31 -040079 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
Davide Pesaventoec61b742020-04-18 01:00:12 -040080}