| 1 | # Configuration file for the Sphinx documentation builder. |
| 2 | # |
| 3 | # This file only contains a selection of the most common options. For a full |
| 4 | # list see the documentation: |
| 5 | # http://www.sphinx-doc.org/en/master/config |
| 6 | |
| 7 | # -- Path setup -------------------------------------------------------------- |
| 8 | |
| 9 | # If extensions (or modules to document with autodoc) are in another directory, |
| 10 | # add these directories to sys.path here. If the directory is relative to the |
| 11 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
| 12 | # |
| 13 | # Always pick up os, to get os.environ, as used below. |
| 14 | import os |
| 15 | # import sys |
| 16 | # sys.path.insert(0, os.path.abspath('.')) |
| 17 | |
| 18 | |
| 19 | # -- Project information ----------------------------------------------------- |
| 20 | |
| 21 | project = "Angband" |
| 22 | copyright = "2019, Angband developers past and present" |
| 23 | author = "Angband developers past and present" |
| 24 | |
| 25 | # The full version, including alpha/beta/rc tags |
| 26 | # There's extra clutter here (and for the HTML theme) to allow conf.py to |
| 27 | # be used as is, to override some settings from the environment (convenient |
| 28 | # for use with autoconf; avoids rewriting conf.py from conf.py.in which breaks |
| 29 | # using conf.py as is), and to allow rewriting for use with CMake. First |
| 30 | # supply something that can be rewritten. |
| 31 | version = "@DOC_VERSION@" |
| 32 | # If that's not modified or gets a dummy value, get the version number |
| 33 | # from the version.sh script. |
| 34 | if (version == "".join(["@", "DOC_VERSION", "@"]) or version == ''): |
| 35 | import subprocess |
| 36 | # Python 3.5 introduces subprocess.run(); use check_output() instead in |
| 37 | # case the system's Python is older than that. |
| 38 | version = subprocess.check_output(['../scripts/version.sh'], |
| 39 | universal_newlines=True) |
| 40 | release = version |
| 41 | |
| 42 | # -- General configuration --------------------------------------------------- |
| 43 | |
| 44 | # 2.0 changed the default value to 'index'. Set this manually for backwards |
| 45 | # compatibility with previous versions. |
| 46 | master_doc = 'index' |
| 47 | |
| 48 | # Add any Sphinx extension module names here, as strings. They can be |
| 49 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 50 | # ones. |
| 51 | extensions = [] |
| 52 | |
| 53 | # Add any paths that contain templates here, relative to this directory. |
| 54 | templates_path = ["_templates"] |
| 55 | |
| 56 | # List of patterns, relative to source directory, that match files and |
| 57 | # directories to ignore when looking for source files. |
| 58 | # This pattern also affects html_static_path and html_extra_path. |
| 59 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 60 | |
| 61 | |
| 62 | # -- Options for HTML output ------------------------------------------------- |
| 63 | |
| 64 | # The theme to use for HTML and HTML Help pages. See the documentation for |
| 65 | # a list of builtin themes. |
| 66 | # Use one of Sphinx's builtin themes if set by the build system. Otherwise |
| 67 | # use the better theme, https://pypi.org/project/sphinx-better-theme/ . |
| 68 | html_theme = "@DOC_HTML_THEME@" |
| 69 | if (html_theme == "".join(["@", "DOC_HTML_THEME", "@"]) or html_theme == ""): |
| 70 | if ("DOC_HTML_THEME" in os.environ |
| 71 | and os.environ["DOC_HTML_THEME"] != "" |
| 72 | and os.environ["DOC_HTML_THEME"] != "none"): |
| 73 | html_theme = os.environ["DOC_HTML_THEME"] |
| 74 | else: |
| 75 | from better import better_theme_path |
| 76 | |
| 77 | html_theme_path = [better_theme_path] |
| 78 | html_theme = "better" |
| 79 | html_theme_options = { |
| 80 | "cssfiles": ["_static/style.css"], |
| 81 | "showheader": True, |
| 82 | "textcolor": "rgb(230, 230, 242)", |
| 83 | "headtextcolor": "rgb(253, 229, 164)", |
| 84 | } |
| 85 | |
| 86 | html_title = "<img> The Angband Manual" |
| 87 | html_short_title = "Home" |
| 88 | html_sidebars = { |
| 89 | "**": ["localtoc.html", "searchbox.html"], |
| 90 | "index": ["globaltoc.html", "searchbox.html"], |
| 91 | } |
| 92 | |
| 93 | |
| 94 | # Add any paths that contain custom static files (such as style sheets) here, |
| 95 | # relative to this directory. They are copied after the builtin static files, |
| 96 | # so a file named "default.css" will overwrite the builtin "default.css". |
| 97 | html_static_path = ["_static"] |