blob: dd5c24516735db66cb772dd7205ab0bb140948d3 [file] [log] [blame]
Davide Pesavento133067f2020-04-02 22:08:27 -04001# Configuration file for the Sphinx documentation builder.
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05002#
Davide Pesaventoe010c782022-09-23 21:40:06 -04003# For the full list of built-in configuration values, see the documentation:
Davide Pesavento51189592021-10-02 22:34:34 -04004# https://www.sphinx-doc.org/en/master/usage/configuration.html
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05005
Davide Pesaventoe010c782022-09-23 21:40:06 -04006import importlib.util
Davide Pesavento133067f2020-04-02 22:08:27 -04007import sys
Davide Pesavento133067f2020-04-02 22:08:27 -04008
9# -- Project information -----------------------------------------------------
Davide Pesaventoe010c782022-09-23 21:40:06 -040010# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Davide Pesavento133067f2020-04-02 22:08:27 -040011
Davide Pesaventoe010c782022-09-23 21:40:06 -040012project = 'PSync: Partial/Full Synchronization Protocol for NDN'
Davide Pesavento6a562f02024-04-22 01:11:31 -040013copyright = 'Copyright © 2018-2024 Named Data Networking Project.'
Davide Pesaventoe010c782022-09-23 21:40:06 -040014author = 'Named Data Networking Project'
Davide Pesavento133067f2020-04-02 22:08:27 -040015
Davide Pesavento51189592021-10-02 22:34:34 -040016# The short X.Y version.
Davide Pesavento133067f2020-04-02 22:08:27 -040017#version = ''
18
Davide Pesavento51189592021-10-02 22:34:34 -040019# The full version, including alpha/beta/rc tags.
Davide Pesavento133067f2020-04-02 22:08:27 -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 Pesaventoe010c782022-09-23 21:40:06 -040030# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050031
Davide Pesaventoe010c782022-09-23 21:40:06 -040032needs_sphinx = '4.0'
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050033extensions = [
Davide Pesavento133067f2020-04-02 22:08:27 -040034 'sphinx.ext.extlinks',
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050035 'sphinx.ext.todo',
36]
37
Davide Pesaventoe010c782022-09-23 21:40:06 -040038def addExtensionIfExists(extension: str):
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050039 try:
Davide Pesaventoe010c782022-09-23 21:40:06 -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:
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050046 extensions.append(extension)
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050047
Davide Pesavento133067f2020-04-02 22:08:27 -040048addExtensionIfExists('sphinxcontrib.doxylink')
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050049
Davide Pesavento133067f2020-04-02 22:08:27 -040050templates_path = ['_templates']
Davide Pesaventoe010c782022-09-23 21:40:06 -040051exclude_patterns = ['Thumbs.db', '.DS_Store']
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050052
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050053
Davide Pesavento133067f2020-04-02 22:08:27 -040054# -- Options for HTML output -------------------------------------------------
Davide Pesaventoe010c782022-09-23 21:40:06 -040055# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050056
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050057html_theme = 'named_data_theme'
Davide Pesavento133067f2020-04-02 22:08:27 -040058html_theme_path = ['.']
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -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".
Ashlesh Gawande465d1492019-01-10 15:12:01 -060063html_static_path = ['_static']
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050064
Davide Pesavento51189592021-10-02 22:34:34 -040065html_copy_source = False
66html_show_sourcelink = False
67
68# Disable syntax highlighting of code blocks by default.
69highlight_language = 'none'
70
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050071
Davide Pesaventoe010c782022-09-23 21:40:06 -040072# -- Misc options ------------------------------------------------------------
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050073
74doxylink = {
Davide Pesavento133067f2020-04-02 22:08:27 -040075 'PSync': ('PSync.tag', 'doxygen/'),
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050076}
77
Davide Pesavento133067f2020-04-02 22:08:27 -040078extlinks = {
Davide Pesaventoe010c782022-09-23 21:40:06 -040079 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'),
Davide Pesavento133067f2020-04-02 22:08:27 -040080}