blob: 8e1f755571d92b124188a287cb636c25c8391841 [file] [log] [blame]
Davide Pesaventof6be8e32020-04-30 16:06:03 -04001# Configuration file for the Sphinx documentation builder.
Vince Lehmanb722b102014-08-24 16:33:49 -05002#
Davide Pesaventod1cb0632022-09-21 14:19:26 -04003# For the full list of built-in configuration values, see the documentation:
Davide Pesavento7ae8b082021-10-12 21:45:47 -04004# https://www.sphinx-doc.org/en/master/usage/configuration.html
Vince Lehmanb722b102014-08-24 16:33:49 -05005
Davide Pesaventod1cb0632022-09-21 14:19:26 -04006import importlib.util
Davide Pesaventof6be8e32020-04-30 16:06:03 -04007import sys
Davide Pesaventof6be8e32020-04-30 16:06:03 -04008
9# -- Project information -----------------------------------------------------
Davide Pesaventod1cb0632022-09-21 14:19:26 -040010# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Davide Pesaventof6be8e32020-04-30 16:06:03 -040011
Davide Pesaventod1cb0632022-09-21 14:19:26 -040012project = 'Named Data Link State Routing Protocol (NLSR)'
Davide Pesaventod4c2a1c2024-01-20 18:22:22 -050013copyright = 'Copyright © 2014-2024 Named Data Networking Project.'
Davide Pesaventod1cb0632022-09-21 14:19:26 -040014author = 'Named Data Networking Project'
Davide Pesaventof6be8e32020-04-30 16:06:03 -040015
Davide Pesavento7ae8b082021-10-12 21:45:47 -040016# The short X.Y version.
Davide Pesaventof6be8e32020-04-30 16:06:03 -040017#version = ''
18
Davide Pesavento7ae8b082021-10-12 21:45:47 -040019# The full version, including alpha/beta/rc tags.
Davide Pesaventof6be8e32020-04-30 16:06:03 -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 Pesaventod1cb0632022-09-21 14:19:26 -040030# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Vince Lehmanb722b102014-08-24 16:33:49 -050031
Davide Pesaventod1cb0632022-09-21 14:19:26 -040032needs_sphinx = '4.0'
Vince Lehmanb722b102014-08-24 16:33:49 -050033extensions = [
Davide Pesaventof6be8e32020-04-30 16:06:03 -040034 'sphinx.ext.extlinks',
Vince Lehmanb722b102014-08-24 16:33:49 -050035 'sphinx.ext.todo',
36]
37
Davide Pesaventod1cb0632022-09-21 14:19:26 -040038def addExtensionIfExists(extension: str):
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070039 try:
Davide Pesaventod1cb0632022-09-21 14:19:26 -040040 if importlib.util.find_spec(extension) is None:
41 raise ModuleNotFoundError(extension)
42 except (ImportError, ValueError):
43 sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
44 'Some documentation may not build correctly.\n')
45 else:
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070046 extensions.append(extension)
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070047
Davide Pesaventof6be8e32020-04-30 16:06:03 -040048addExtensionIfExists('sphinxcontrib.doxylink')
Vince Lehmanb722b102014-08-24 16:33:49 -050049
Davide Pesaventof6be8e32020-04-30 16:06:03 -040050templates_path = ['_templates']
Davide Pesaventod1cb0632022-09-21 14:19:26 -040051exclude_patterns = ['Thumbs.db', '.DS_Store']
Vince Lehmanb722b102014-08-24 16:33:49 -050052
Vince Lehmanb722b102014-08-24 16:33:49 -050053
Davide Pesaventof6be8e32020-04-30 16:06:03 -040054# -- Options for HTML output -------------------------------------------------
Davide Pesaventod1cb0632022-09-21 14:19:26 -040055# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Vince Lehmanb722b102014-08-24 16:33:49 -050056
Vince Lehmanb722b102014-08-24 16:33:49 -050057html_theme = 'named_data_theme'
Davide Pesaventof6be8e32020-04-30 16:06:03 -040058html_theme_path = ['.']
Vince Lehmanb722b102014-08-24 16:33:49 -050059
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 Pesavento7ae8b082021-10-12 21:45:47 -040065html_copy_source = False
66html_show_sourcelink = False
67
68# Disable syntax highlighting of code blocks by default.
69highlight_language = 'none'
70
Vince Lehmanb722b102014-08-24 16:33:49 -050071
Davide Pesaventof6be8e32020-04-30 16:06:03 -040072# -- Options for manual page output ------------------------------------------
Davide Pesaventod1cb0632022-09-21 14:19:26 -040073# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-manual-page-output
Vince Lehmanb722b102014-08-24 16:33:49 -050074
75# One entry per manual page. List of tuples
76# (source start file, name, description, authors, manual section).
77man_pages = [
Davide Pesaventod1cb0632022-09-21 14:19:26 -040078 ('manpages/nlsr', 'nlsr', 'Named Data Link State Routing daemon', [], 1),
79 ('manpages/nlsr.conf', 'nlsr.conf', 'Named Data Link State Routing daemon configuration file', [], 5),
80 ('manpages/nlsrc', 'nlsrc', 'command-line utility to interact with and collect statistics from NLSR', [], 1),
Vince Lehmanb722b102014-08-24 16:33:49 -050081]
82
Alexander Afanasyev7decbbf2014-08-24 21:29:01 -070083
Davide Pesaventod1cb0632022-09-21 14:19:26 -040084# -- Misc options ------------------------------------------------------------
Davide Pesaventof6be8e32020-04-30 16:06:03 -040085
86doxylink = {
87 'nlsr': ('NLSR.tag', 'doxygen/'),
88}
89
90extlinks = {
Davide Pesaventod1cb0632022-09-21 14:19:26 -040091 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
Davide Pesaventof6be8e32020-04-30 16:06:03 -040092}