Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 1 | # Configuration file for the Sphinx documentation builder. |
| 2 | # |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 3 | # For the full list of built-in configuration values, see the documentation: |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 5 | |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 6 | import importlib.util |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 7 | import sys |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 8 | |
| 9 | # -- Project information ----------------------------------------------------- |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 10 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 11 | |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 12 | project = 'NAC: Name-based Access Control library' |
Davide Pesavento | d64a9d1 | 2023-01-01 16:30:03 -0500 | [diff] [blame] | 13 | copyright = 'Copyright © 2014-2023 Regents of the University of California.' |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 14 | author = 'Named Data Networking Project' |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 15 | |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 16 | # The short X.Y version. |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 17 | #version = '' |
| 18 | |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 19 | # The full version, including alpha/beta/rc tags. |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 20 | #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. |
| 26 | today_fmt = '%Y-%m-%d' |
| 27 | |
| 28 | |
| 29 | # -- General configuration --------------------------------------------------- |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 30 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 31 | |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 32 | needs_sphinx = '4.0' |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 33 | extensions = [ |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 34 | 'sphinx.ext.extlinks', |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 35 | 'sphinx.ext.todo', |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 36 | ] |
| 37 | |
Davide Pesavento | a3665fe | 2022-09-25 03:16:31 -0400 | [diff] [blame] | 38 | def addExtensionIfExists(extension: str): |
| 39 | try: |
| 40 | if importlib.util.find_spec(extension) is None: |
| 41 | raise ModuleNotFoundError(extension) |
| 42 | except (ImportError, ValueError): |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 43 | sys.stderr.write(f'WARNING: Extension {extension!r} not found. ' |
Davide Pesavento | a3665fe | 2022-09-25 03:16:31 -0400 | [diff] [blame] | 44 | 'Some documentation may not build correctly.\n') |
| 45 | else: |
| 46 | extensions.append(extension) |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 47 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 48 | addExtensionIfExists('sphinxcontrib.doxylink') |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 49 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 50 | templates_path = ['_templates'] |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 51 | exclude_patterns = ['Thumbs.db', '.DS_Store'] |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 52 | |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 53 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 54 | # -- Options for HTML output ------------------------------------------------- |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 55 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 56 | |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 57 | html_theme = 'named_data_theme' |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 58 | html_theme_path = ['.'] |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 59 | |
| 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". |
| 63 | html_static_path = ['_static'] |
| 64 | |
Davide Pesavento | 3c7f645 | 2021-10-02 04:06:26 -0400 | [diff] [blame] | 65 | html_copy_source = False |
| 66 | html_show_sourcelink = False |
| 67 | |
| 68 | # Disable syntax highlighting of code blocks by default. |
| 69 | highlight_language = 'none' |
| 70 | |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 71 | |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 72 | # -- Misc options ------------------------------------------------------------ |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 73 | |
| 74 | doxylink = { |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 75 | 'nac': ('nac.tag', 'doxygen/'), |
Alexander Afanasyev | 6e64ac9 | 2018-06-14 17:25:38 -0400 | [diff] [blame] | 76 | } |
| 77 | |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 78 | extlinks = { |
Davide Pesavento | 344e75c | 2022-09-19 23:14:31 -0400 | [diff] [blame] | 79 | 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'), |
Davide Pesavento | ec61b74 | 2020-04-18 01:00:12 -0400 | [diff] [blame] | 80 | } |