blob: 199e8d6792847f5bc37be3e1a9152765f13c4ad8 [file] [log] [blame]
Davide Pesaventoa0546db2020-04-01 19:18:04 -04001# Configuration file for the Sphinx documentation builder.
Yingdi Yu06a678a2014-08-01 17:07:08 -07002#
Davide Pesavento55492d52022-09-19 18:38:02 -04003# For the full list of built-in configuration values, see the documentation:
Davide Pesavento22eeb292021-10-01 21:20:53 -04004# https://www.sphinx-doc.org/en/master/usage/configuration.html
Yingdi Yu06a678a2014-08-01 17:07:08 -07005
Davide Pesavento55492d52022-09-19 18:38:02 -04006import importlib.util
Davide Pesaventoa0546db2020-04-01 19:18:04 -04007import sys
Davide Pesaventoa0546db2020-04-01 19:18:04 -04008
9# -- Project information -----------------------------------------------------
Davide Pesavento55492d52022-09-19 18:38:02 -040010# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Davide Pesaventoa0546db2020-04-01 19:18:04 -040011
Davide Pesavento55492d52022-09-19 18:38:02 -040012project = 'ChronoSync: A Synchronization Protocol for NDN'
Davide Pesavento85601032023-02-14 03:02:02 -050013copyright = 'Copyright © 2012-2023 Regents of the University of California.'
Davide Pesavento55492d52022-09-19 18:38:02 -040014author = 'Named Data Networking Project'
Davide Pesaventoa0546db2020-04-01 19:18:04 -040015
Davide Pesavento22eeb292021-10-01 21:20:53 -040016# The short X.Y version.
Davide Pesaventoa0546db2020-04-01 19:18:04 -040017#version = ''
18
Davide Pesavento22eeb292021-10-01 21:20:53 -040019# The full version, including alpha/beta/rc tags.
Davide Pesaventoa0546db2020-04-01 19:18:04 -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 Pesavento55492d52022-09-19 18:38:02 -040030# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Yingdi Yu06a678a2014-08-01 17:07:08 -070031
Davide Pesavento55492d52022-09-19 18:38:02 -040032needs_sphinx = '4.0'
Yingdi Yu06a678a2014-08-01 17:07:08 -070033extensions = [
Davide Pesavento22eeb292021-10-01 21:20:53 -040034 'sphinx.ext.extlinks',
Yingdi Yu06a678a2014-08-01 17:07:08 -070035 'sphinx.ext.todo',
36]
37
Davide Pesavento044ecc92022-09-25 03:10:03 -040038def addExtensionIfExists(extension: str):
39 try:
40 if importlib.util.find_spec(extension) is None:
41 raise ModuleNotFoundError(extension)
42 except (ImportError, ValueError):
Davide Pesavento55492d52022-09-19 18:38:02 -040043 sys.stderr.write(f'WARNING: Extension {extension!r} not found. '
Davide Pesavento044ecc92022-09-25 03:10:03 -040044 'Some documentation may not build correctly.\n')
45 else:
46 extensions.append(extension)
Yingdi Yu06a678a2014-08-01 17:07:08 -070047
Davide Pesaventoa0546db2020-04-01 19:18:04 -040048addExtensionIfExists('sphinxcontrib.doxylink')
Yingdi Yu06a678a2014-08-01 17:07:08 -070049
Davide Pesaventoa0546db2020-04-01 19:18:04 -040050templates_path = ['_templates']
Davide Pesavento55492d52022-09-19 18:38:02 -040051exclude_patterns = ['Thumbs.db', '.DS_Store', 'RELEASE_NOTES.rst']
Yingdi Yu06a678a2014-08-01 17:07:08 -070052
53
Davide Pesaventoa0546db2020-04-01 19:18:04 -040054# -- Options for HTML output -------------------------------------------------
Davide Pesavento55492d52022-09-19 18:38:02 -040055# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Yingdi Yu06a678a2014-08-01 17:07:08 -070056
Yingdi Yu06a678a2014-08-01 17:07:08 -070057html_theme = 'named_data_theme'
Davide Pesaventoa0546db2020-04-01 19:18:04 -040058html_theme_path = ['.']
Yingdi Yu06a678a2014-08-01 17:07:08 -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".
Davide Pesaventoa0546db2020-04-01 19:18:04 -040063html_static_path = ['_static']
Yingdi Yu06a678a2014-08-01 17:07:08 -070064
Davide Pesavento22eeb292021-10-01 21:20:53 -040065html_copy_source = False
66html_show_sourcelink = False
67
68# Disable syntax highlighting of code blocks by default.
69highlight_language = 'none'
70
Yingdi Yu06a678a2014-08-01 17:07:08 -070071
Davide Pesavento55492d52022-09-19 18:38:02 -040072# -- Misc options ------------------------------------------------------------
Yingdi Yu06a678a2014-08-01 17:07:08 -070073
74doxylink = {
Davide Pesaventoa0546db2020-04-01 19:18:04 -040075 'ChronoSync': ('ChronoSync.tag', 'doxygen/'),
Yingdi Yu06a678a2014-08-01 17:07:08 -070076}
Davide Pesavento22eeb292021-10-01 21:20:53 -040077
78extlinks = {
Davide Pesavento55492d52022-09-19 18:38:02 -040079 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
Davide Pesavento22eeb292021-10-01 21:20:53 -040080}