|
| 1 | +# If extensions (or modules to document with autodoc) are in another directory, |
| 2 | +# add these directories to sys.path here. If the directory is relative to the |
| 3 | +# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 4 | + |
| 5 | +from sys import path as sys_path |
| 6 | +from os.path import abspath |
| 7 | +from pathlib import Path |
| 8 | +from json import loads |
| 9 | + |
| 10 | + |
| 11 | +ROOT = Path(__file__).resolve().parent |
| 12 | + |
| 13 | +sys_path.insert(0, abspath('.')) |
| 14 | +sys_path.insert(0, abspath('..')) |
| 15 | + |
| 16 | + |
| 17 | +# ============================================================================== |
| 18 | +# Project information |
| 19 | +# ============================================================================== |
| 20 | +project = "pyEDAA.Launcher" |
| 21 | +copyright = "2021-2021 Patrick Lehmann - Boetzingen, Germany" |
| 22 | +author = "Patrick Lehmann" |
| 23 | + |
| 24 | +version = "latest" # The short X.Y version. |
| 25 | +release = "latest" # The full version, including alpha/beta/rc tags. |
| 26 | + |
| 27 | + |
| 28 | +# ============================================================================== |
| 29 | +# Miscellaneous settings |
| 30 | +# ============================================================================== |
| 31 | +# The master toctree document. |
| 32 | +master_doc = 'index' |
| 33 | + |
| 34 | +# Add any paths that contain templates here, relative to this directory. |
| 35 | +templates_path = ['_templates'] |
| 36 | + |
| 37 | +# List of patterns, relative to source directory, that match files and |
| 38 | +# directories to ignore when looking for source files. |
| 39 | +# This pattern also affects html_static_path and html_extra_path. |
| 40 | +exclude_patterns = [ |
| 41 | + "_build", |
| 42 | + "_themes", |
| 43 | + "Thumbs.db", |
| 44 | + ".DS_Store" |
| 45 | +] |
| 46 | + |
| 47 | +# The name of the Pygments (syntax highlighting) style to use. |
| 48 | +pygments_style = 'stata-dark' |
| 49 | + |
| 50 | + |
| 51 | +# ============================================================================== |
| 52 | +# Restructured Text settings |
| 53 | +# ============================================================================== |
| 54 | +prologPath = "prolog.inc" |
| 55 | +try: |
| 56 | + with open(prologPath, "r") as prologFile: |
| 57 | + rst_prolog = prologFile.read() |
| 58 | +except Exception as ex: |
| 59 | + print("[ERROR:] While reading '{0!s}'.".format(prologPath)) |
| 60 | + print(ex) |
| 61 | + rst_prolog = "" |
| 62 | + |
| 63 | + |
| 64 | +# ============================================================================== |
| 65 | +# Options for HTML output |
| 66 | +# ============================================================================== |
| 67 | + |
| 68 | +html_context = {} |
| 69 | +ctx = ROOT / 'context.json' |
| 70 | +if ctx.is_file(): |
| 71 | + html_context.update(loads(ctx.open('r').read())) |
| 72 | + |
| 73 | +if (ROOT / "_theme").is_dir(): |
| 74 | + html_theme_path = ["."] |
| 75 | + html_theme = "_theme" |
| 76 | + html_theme_options = { |
| 77 | + 'logo_only': True, |
| 78 | + 'home_breadcrumbs': False, |
| 79 | + 'vcs_pageview_mode': 'blob', |
| 80 | + } |
| 81 | +else: |
| 82 | + html_theme = "alabaster" |
| 83 | + |
| 84 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 85 | +# relative to this directory. They are copied after the builtin static files, |
| 86 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 87 | +html_static_path = ['_static'] |
| 88 | + |
| 89 | +html_logo = str(Path(html_static_path[0]) / "logo.svg") |
| 90 | +html_favicon = str(Path(html_static_path[0]) / "favicon.svg") |
| 91 | + |
| 92 | +# Output file base name for HTML help builder. |
| 93 | +htmlhelp_basename = 'pyEDAALauncherDoc' |
| 94 | + |
| 95 | +# If not None, a 'Last updated on:' timestamp is inserted at every page |
| 96 | +# bottom, using the given strftime format. |
| 97 | +# The empty string is equivalent to '%b %d, %Y'. |
| 98 | +html_last_updated_fmt = "%d.%m.%Y" |
| 99 | + |
| 100 | + |
| 101 | +# ============================================================================== |
| 102 | +# Options for LaTeX / PDF output |
| 103 | +# ============================================================================== |
| 104 | +from textwrap import dedent |
| 105 | + |
| 106 | +latex_elements = { |
| 107 | + # The paper size ('letterpaper' or 'a4paper'). |
| 108 | + 'papersize': 'a4paper', |
| 109 | + |
| 110 | + # The font size ('10pt', '11pt' or '12pt'). |
| 111 | + #'pointsize': '10pt', |
| 112 | + |
| 113 | + # Additional stuff for the LaTeX preamble. |
| 114 | + 'preamble': dedent(r""" |
| 115 | + % ================================================================================ |
| 116 | + % User defined additional preamble code |
| 117 | + % ================================================================================ |
| 118 | + % Add more Unicode characters for pdfLaTeX. |
| 119 | + % - Alternatively, compile with XeLaTeX or LuaLaTeX. |
| 120 | + % - https://GitHub.com/sphinx-doc/sphinx/issues/3511 |
| 121 | + % |
| 122 | + \ifdefined\DeclareUnicodeCharacter |
| 123 | + \DeclareUnicodeCharacter{2265}{$\geq$} |
| 124 | + \DeclareUnicodeCharacter{21D2}{$\Rightarrow$} |
| 125 | + \fi |
| 126 | +
|
| 127 | +
|
| 128 | + % ================================================================================ |
| 129 | + """), |
| 130 | + |
| 131 | + # Latex figure (float) alignment |
| 132 | + #'figure_align': 'htbp', |
| 133 | +} |
| 134 | + |
| 135 | +# Grouping the document tree into LaTeX files. List of tuples |
| 136 | +# (source start file, target name, title, |
| 137 | +# author, documentclass [howto, manual, or own class]). |
| 138 | +latex_documents = [ |
| 139 | + ( master_doc, |
| 140 | + 'pyEDAA.Launcher.tex', |
| 141 | + 'The pyEDAA.Launcher Documentation', |
| 142 | + 'Patrick Lehmann', |
| 143 | + 'manual' |
| 144 | + ), |
| 145 | +] |
| 146 | + |
| 147 | + |
| 148 | +# ============================================================================== |
| 149 | +# Extensions |
| 150 | +# ============================================================================== |
| 151 | +extensions = [ |
| 152 | + 'sphinx.ext.extlinks', |
| 153 | + 'sphinx.ext.intersphinx', |
| 154 | +] |
| 155 | + |
| 156 | + |
| 157 | +# ============================================================================== |
| 158 | +# Sphinx.Ext.InterSphinx |
| 159 | +# ============================================================================== |
| 160 | +intersphinx_mapping = { |
| 161 | + 'python': ('https://docs.python.org/3', None), |
| 162 | +} |
| 163 | + |
| 164 | + |
| 165 | +# ============================================================================== |
| 166 | +# Sphinx.Ext.ExtLinks |
| 167 | +# ============================================================================== |
| 168 | +extlinks = { |
| 169 | + 'ghissue': ('https://GitHub.com/edaa-org/pyEDAA.Launcher/issues/%s', 'issue #'), |
| 170 | + 'ghpull': ('https://GitHub.com/edaa-org/pyEDAA.Launcher/pull/%s', 'pull request #'), |
| 171 | + 'ghsrc': ('https://GitHub.com/edaa-org/pyEDAA.Launcher/blob/main/%s', ''), |
| 172 | +} |
0 commit comments