Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 1 | # Configuration file for the Sphinx documentation builder. |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 2 | # |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 3 | # For the full list of built-in configuration values, see the documentation: |
Davide Pesavento | 7ae8b08 | 2021-10-12 21:45:47 -0400 | [diff] [blame] | 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 5 | |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 6 | import importlib.util |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 7 | import sys |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 8 | |
| 9 | # -- Project information ----------------------------------------------------- |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 10 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 11 | |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 12 | project = 'Named Data Link State Routing Protocol (NLSR)' |
| 13 | copyright = 'Copyright © 2014-2022 Named Data Networking Project.' |
| 14 | author = 'Named Data Networking Project' |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 15 | |
Davide Pesavento | 7ae8b08 | 2021-10-12 21:45:47 -0400 | [diff] [blame] | 16 | # The short X.Y version. |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 17 | #version = '' |
| 18 | |
Davide Pesavento | 7ae8b08 | 2021-10-12 21:45:47 -0400 | [diff] [blame] | 19 | # The full version, including alpha/beta/rc tags. |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -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 | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 30 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 31 | |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 32 | needs_sphinx = '4.0' |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 33 | extensions = [ |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 34 | 'sphinx.ext.extlinks', |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 35 | 'sphinx.ext.todo', |
| 36 | ] |
| 37 | |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 38 | def addExtensionIfExists(extension: str): |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 39 | try: |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 40 | 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 Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 46 | extensions.append(extension) |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 47 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 48 | addExtensionIfExists('sphinxcontrib.doxylink') |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 49 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 50 | templates_path = ['_templates'] |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 51 | exclude_patterns = ['Thumbs.db', '.DS_Store'] |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 52 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 53 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 54 | # -- Options for HTML output ------------------------------------------------- |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 55 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 56 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 57 | html_theme = 'named_data_theme' |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 58 | html_theme_path = ['.'] |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [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 | 7ae8b08 | 2021-10-12 21:45:47 -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 | |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 71 | |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 72 | # -- Options for manual page output ------------------------------------------ |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 73 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-manual-page-output |
Vince Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 74 | |
| 75 | # One entry per manual page. List of tuples |
| 76 | # (source start file, name, description, authors, manual section). |
| 77 | man_pages = [ |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 78 | ('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 Lehman | b722b10 | 2014-08-24 16:33:49 -0500 | [diff] [blame] | 81 | ] |
| 82 | |
Alexander Afanasyev | 7decbbf | 2014-08-24 21:29:01 -0700 | [diff] [blame] | 83 | |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 84 | # -- Misc options ------------------------------------------------------------ |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 85 | |
| 86 | doxylink = { |
| 87 | 'nlsr': ('NLSR.tag', 'doxygen/'), |
| 88 | } |
| 89 | |
| 90 | extlinks = { |
Davide Pesavento | d1cb063 | 2022-09-21 14:19:26 -0400 | [diff] [blame^] | 91 | 'issue': ('https://redmine.named-data.net/issues/%s', 'issue #%s'), |
Davide Pesavento | f6be8e3 | 2020-04-30 16:06:03 -0400 | [diff] [blame] | 92 | } |