blob: d1a6386cbc0c52a14ad0dbcf13a8f9b89dea2166 [file] [log] [blame]
Davide Pesaventofee7ee32020-04-15 02:45:07 -04001# Configuration file for the Sphinx documentation builder.
2#
Davide Pesavento872f18e2022-09-20 17:03:22 -04003# For the full list of built-in configuration values, see the documentation:
Davide Pesavento3d01fa32021-10-03 17:13:38 -04004# https://www.sphinx-doc.org/en/master/usage/configuration.html
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -07005
Davide Pesavento872f18e2022-09-20 17:03:22 -04006import importlib.util
Davide Pesaventofee7ee32020-04-15 02:45:07 -04007import sys
Davide Pesaventofee7ee32020-04-15 02:45:07 -04008
9# -- Project information -----------------------------------------------------
Davide Pesavento872f18e2022-09-20 17:03:22 -040010# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Davide Pesaventofee7ee32020-04-15 02:45:07 -040011
Davide Pesavento872f18e2022-09-20 17:03:22 -040012project = 'NDNS: Domain Name Service for Named Data Networking'
Davide Pesaventodadbc3e2023-02-14 02:32:36 -050013copyright = 'Copyright © 2014-2023 Named Data Networking Project.'
Davide Pesavento872f18e2022-09-20 17:03:22 -040014author = 'Named Data Networking Project'
Davide Pesaventofee7ee32020-04-15 02:45:07 -040015
Davide Pesavento3d01fa32021-10-03 17:13:38 -040016# The short X.Y version.
Davide Pesaventofee7ee32020-04-15 02:45:07 -040017#version = ''
18
Davide Pesavento3d01fa32021-10-03 17:13:38 -040019# The full version, including alpha/beta/rc tags.
Davide Pesaventofee7ee32020-04-15 02:45:07 -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 Pesavento872f18e2022-09-20 17:03:22 -040030# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070031
Davide Pesavento872f18e2022-09-20 17:03:22 -040032needs_sphinx = '4.0'
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070033extensions = [
Davide Pesaventofee7ee32020-04-15 02:45:07 -040034 'sphinx.ext.extlinks',
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070035 'sphinx.ext.todo',
36]
37
Davide Pesavento67272972023-03-16 17:20:22 -040038def addExtensionIfExists(extension: str):
39 try:
40 if importlib.util.find_spec(extension) is None:
41 raise ModuleNotFoundError(extension)
42 except (ImportError, ValueError):
Davide Pesavento872f18e2022-09-20 17:03:22 -040043 sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
Davide Pesavento67272972023-03-16 17:20:22 -040044 'Some documentation may not build correctly.\n')
45 else:
46 extensions.append(extension)
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070047
Davide Pesaventofee7ee32020-04-15 02:45:07 -040048addExtensionIfExists('sphinxcontrib.doxylink')
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070049
Davide Pesaventofee7ee32020-04-15 02:45:07 -040050templates_path = ['_templates']
Davide Pesavento872f18e2022-09-20 17:03:22 -040051exclude_patterns = ['Thumbs.db', '.DS_Store']
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070052
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070053
Davide Pesaventofee7ee32020-04-15 02:45:07 -040054# -- Options for HTML output -------------------------------------------------
Davide Pesavento872f18e2022-09-20 17:03:22 -040055# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070056
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070057html_theme = 'named_data_theme'
Davide Pesaventofee7ee32020-04-15 02:45:07 -040058html_theme_path = ['.']
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070059
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 Pesavento3d01fa32021-10-03 17:13:38 -040065html_copy_source = False
66html_show_sourcelink = False
67
68# Disable syntax highlighting of code blocks by default.
69highlight_language = 'none'
70
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070071
Davide Pesaventofee7ee32020-04-15 02:45:07 -040072# -- Options for manual page output ------------------------------------------
Davide Pesavento872f18e2022-09-20 17:03:22 -040073# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-manual-page-output
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070074
75# One entry per manual page. List of tuples
76# (source start file, name, description, authors, manual section).
77man_pages = [
Davide Pesavento872f18e2022-09-20 17:03:22 -040078 ('manpages/ndns-daemon', 'ndns-daemon', 'Domain Name Service Daemon for Named Data Networking', None, 1),
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070079]
80
Davide Pesaventofee7ee32020-04-15 02:45:07 -040081
Davide Pesavento872f18e2022-09-20 17:03:22 -040082# -- Misc options ------------------------------------------------------------
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070083
84doxylink = {
Davide Pesaventofee7ee32020-04-15 02:45:07 -040085 'NDNS': ('NDNS.tag', 'doxygen/'),
Alexander Afanasyevbd5b67a2014-09-02 16:06:21 -070086}
87
Davide Pesaventofee7ee32020-04-15 02:45:07 -040088extlinks = {
Davide Pesavento872f18e2022-09-20 17:03:22 -040089 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
Davide Pesaventofee7ee32020-04-15 02:45:07 -040090}