| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# |
| 3 |
# Periodic Table documentation build configuration file, created by |
| 4 |
# sphinx-quickstart on Tue Jun 2 11:16:08 2009. |
| 5 |
# |
| 6 |
# This file is execfile()d with the current directory set to its containing dir. |
| 7 |
# |
| 8 |
# Note that not all possible configuration values are present in this |
| 9 |
# autogenerated file. |
| 10 |
# |
| 11 |
# All configuration values have a default; values that are commented out |
| 12 |
# serve to show the default. |
| 13 |
|
| 14 |
import sys |
| 15 |
import os |
| 16 |
import io |
| 17 |
|
| 18 |
# If extensions (or modules to document with autodoc) are in another directory, |
| 19 |
# add these directories to sys.path here. If the directory is relative to the |
| 20 |
# documentation root, use os.path.abspath to make it absolute, like shown here. |
| 21 |
#sys.path.append(os.path.abspath('_extensions'+(os.path.dirname('../../periodictable')))) |
| 22 |
|
| 23 |
import glob |
| 24 |
sys.path.insert(0, os.path.abspath('.')) # needed for extension tests |
| 25 |
#buildpath = glob.glob('../../build/lib*')[0] |
| 26 |
#sys.path.insert(0, os.path.abspath(buildpath)) |
| 27 |
sys.path.insert(0, os.path.abspath('../..')) |
| 28 |
sys.path.insert(0, os.path.abspath('_extensions')) |
| 29 |
import periodictable |
| 30 |
|
| 31 |
|
| 32 |
# -- General configuration ----------------------------------------------------- |
| 33 |
|
| 34 |
# Add any Sphinx extension module names here, as strings. They can be extensions |
| 35 |
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
| 36 |
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', |
| 37 |
'sphinx.ext.coverage', |
| 38 |
#'sphinx.ext.pngmath', |
| 39 |
'sphinx.ext.mathjax', |
| 40 |
#'only_directives', |
| 41 |
#'matplotlib.sphinxext.mathmpl', |
| 42 |
'matplotlib.sphinxext.plot_directive', |
| 43 |
'dollarmath', |
| 44 |
] |
| 45 |
|
| 46 |
# MathJax CDN is discontinued |
| 47 |
mathjax_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML" |
| 48 |
|
| 49 |
nitpick_ignore = [ |
| 50 |
('py:class', 'type'), |
| 51 |
('py:class', 'object'), |
| 52 |
|
| 53 |
('py:class', 'collections.abc.Buffer'), |
| 54 |
('py:class', 'collections.abc.Callable'), |
| 55 |
('py:class', 'collections.abc.Iterator'), |
| 56 |
('py:class', 'collections.abc.Sequence'), |
| 57 |
('py:class', 'pathlib.Path'), |
| 58 |
|
| 59 |
('py:class', 'numpy.dtype'), |
| 60 |
('py:class', 'numpy.ndarray'), |
| 61 |
('py:class', 'numpy.float64'), |
| 62 |
('py:class', 'numpy._typing._array_like._Buffer'), |
| 63 |
('py:class', 'numpy._typing._array_like._ScalarType_co'), |
| 64 |
('py:class', 'numpy._typing._array_like._SupportsArray'), |
| 65 |
('py:class', 'numpy._typing._array_like._ScalarT'), |
| 66 |
('py:class', 'numpy._typing._nested_sequence._NestedSequence'), |
| 67 |
('py:class', 'pyparsing.core.ParserElement'), |
| 68 |
|
| 69 |
('py:class', 'periodictable.core._AtomBase'), |
| 70 |
('py:class', 'periodictable.core.IonSet'), |
| 71 |
('py:class', 'periodictable.core.AtomVar'), |
| 72 |
('py:class', 'Fragment'), |
| 73 |
('py:class', 'FormulaInput'), |
| 74 |
] |
| 75 |
|
| 76 |
# Add any paths that contain templates here, relative to this directory. |
| 77 |
templates_path = ['_templates'] |
| 78 |
|
| 79 |
# The suffix of source filenames. |
| 80 |
source_suffix = '.rst' |
| 81 |
|
| 82 |
# The encoding of source files. |
| 83 |
#source_encoding = 'utf-8' |
| 84 |
|
| 85 |
# The master toctree document. |
| 86 |
master_doc = 'index' |
| 87 |
|
| 88 |
# General information about the project. |
| 89 |
project = 'Periodic Table' |
| 90 |
copyright = '2024, Paul Kienzle' |
| 91 |
|
| 92 |
# The version info for the project you're documenting, acts as replacement for |
| 93 |
# |version| and |release|, also used in various other places throughout the |
| 94 |
# built documents. |
| 95 |
# |
| 96 |
# The short X.Y version. |
| 97 |
version = periodictable.__version__ |
| 98 |
# The full version, including alpha/beta/rc tags. |
| 99 |
release = version |
| 100 |
|
| 101 |
# The language for content autogenerated by Sphinx. Refer to documentation |
| 102 |
# for a list of supported languages. |
| 103 |
#language = None |
| 104 |
|
| 105 |
# There are two options for replacing |today|: either, you set today to some |
| 106 |
# non-false value, then it is used: |
| 107 |
#today = '' |
| 108 |
# Else, today_fmt is used as the format for a strftime call. |
| 109 |
#today_fmt = '%B %d, %Y' |
| 110 |
|
| 111 |
# List of documents that shouldn't be included in the build. |
| 112 |
#unused_docs = [] |
| 113 |
|
| 114 |
# List of directories, relative to source directory, that shouldn't be searched |
| 115 |
# for source files. |
| 116 |
exclude_trees = ['_*','build','plots','shelltable','discoverer'] |
| 117 |
|
| 118 |
# The reST default role (used for this markup: `text`) to use for all documents. |
| 119 |
#default_role = None |
| 120 |
|
| 121 |
# If true, '()' will be appended to :func: etc. cross-reference text. |
| 122 |
#add_function_parentheses = True |
| 123 |
|
| 124 |
# If true, the current module name will be prepended to all description |
| 125 |
# unit titles (such as .. function::). |
| 126 |
#add_module_names = True |
| 127 |
|
| 128 |
# If true, sectionauthor and moduleauthor directives will be shown in the |
| 129 |
# output. They are ignored by default. |
| 130 |
#show_authors = False |
| 131 |
|
| 132 |
# The name of the Pygments (syntax highlighting) style to use. |
| 133 |
pygments_style = 'sphinx' |
| 134 |
|
| 135 |
# A list of ignored prefixes for module index sorting. |
| 136 |
#modindex_common_prefix = [] |
| 137 |
|
| 138 |
|
| 139 |
# -- Options for HTML output --------------------------------------------------- |
| 140 |
|
| 141 |
# The theme to use for HTML and HTML Help pages. Major themes that come with |
| 142 |
# Sphinx are currently 'default' and 'sphinxdoc'. |
| 143 |
html_theme = 'default' |
| 144 |
html_theme_options = { |
| 145 |
"rightsidebar":"False", |
| 146 |
"relbarbgcolor": "Gainsboro", |
| 147 |
#"codebgcolor": "Beige", |
| 148 |
"footertextcolor": "orange", |
| 149 |
"relbartextcolor": "Blue", |
| 150 |
"sidebarbgcolor": "white", |
| 151 |
"sidebarlinkcolor": "OrangeRed", |
| 152 |
"sidebartextcolor": "Navy", |
| 153 |
"linkcolor": "Blue", |
| 154 |
"relbarlinkcolor": "Blue" |
| 155 |
#"headtextcolor": "Teal" |
| 156 |
#"headbgcolor": "Oldlace", |
| 157 |
} |
| 158 |
|
| 159 |
html_style = 'site.css' |
| 160 |
|
| 161 |
# Theme options are theme-specific and customize the look and feel of a theme |
| 162 |
# further. For a list of options available for each theme, see the |
| 163 |
# documentation PaleTurquoise. |
| 164 |
#html_theme_options = {} |
| 165 |
|
| 166 |
# Add any paths that contain custom themes here, relative to this directory. |
| 167 |
#html_theme_path = [] |
| 168 |
|
| 169 |
# The name for this set of Sphinx documents. If None, it defaults to |
| 170 |
# "<project> v<release> documentation". |
| 171 |
html_title = "PeriodicTable" |
| 172 |
|
| 173 |
# A shorter title for the navigation bar. Default is the same as html_title. |
| 174 |
html_short_title = "Home" |
| 175 |
|
| 176 |
# The name of an image file (relative to this directory) to place at the top |
| 177 |
# of the sidebar. |
| 178 |
#html_logo = '_static/periodic_logo.png' |
| 179 |
|
| 180 |
# The name of an image file (within the static path) to use as favicon of the |
| 181 |
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 182 |
# pixels large. |
| 183 |
#html_favicon = None |
| 184 |
|
| 185 |
# Add any paths that contain custom static files (such as style sheets) here, |
| 186 |
# relative to this directory. They are copied after the builtin static files, |
| 187 |
# so a file named "default.css" will overwrite the builtin "default.css". |
| 188 |
html_static_path = ['_static'] |
| 189 |
|
| 190 |
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
| 191 |
# using the given strftime format. |
| 192 |
#html_last_updated_fmt = '%b %d, %Y' |
| 193 |
|
| 194 |
# If true, SmartyPants will be used to convert quotes and dashes to |
| 195 |
# typographically correct entities. |
| 196 |
#html_use_smartypants = True |
| 197 |
|
| 198 |
# Custom sidebar templates, maps document names to template names. |
| 199 |
#html_sidebars = {} |
| 200 |
|
| 201 |
# Additional templates that should be rendered to pages, maps page names to |
| 202 |
# template names. |
| 203 |
#html_additional_pages = {} |
| 204 |
|
| 205 |
# If false, no module index is generated. |
| 206 |
#html_use_modindex = True |
| 207 |
|
| 208 |
# If false, no index is generated. |
| 209 |
#html_use_index = True |
| 210 |
|
| 211 |
# If true, the index is split into individual pages for each letter. |
| 212 |
#html_split_index = False |
| 213 |
|
| 214 |
# If true, links to the reST sources are added to the pages. |
| 215 |
html_show_sourcelink = False |
| 216 |
|
| 217 |
# If true, an OpenSearch description file will be output, and all pages will |
| 218 |
# contain a <link> tag referring to it. The value of this option must be the |
| 219 |
# base URL from which the finished HTML is served. |
| 220 |
#html_use_opensearch = '' |
| 221 |
|
| 222 |
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). |
| 223 |
#html_file_suffix = '' |
| 224 |
|
| 225 |
# Output file base name for HTML help builder. |
| 226 |
htmlhelp_basename = 'PeriodicTabledoc' |
| 227 |
|
| 228 |
|
| 229 |
# -- Options for LaTeX output -------------------------------------------------- |
| 230 |
|
| 231 |
# The paper size ('letter' or 'a4'). |
| 232 |
#latex_paper_size = 'letter' |
| 233 |
|
| 234 |
# The font size ('10pt', '11pt' or '12pt'). |
| 235 |
#latex_font_size = '10pt' |
| 236 |
|
| 237 |
# Grouping the document tree into LaTeX files. List of tuples |
| 238 |
# (source start file, target name, title, author, documentclass [howto/manual]). |
| 239 |
latex_documents = [ |
| 240 |
('index', 'PeriodicTable.tex', 'Periodic Table Documentation', |
| 241 |
'Paul Kienzle', 'manual'), |
| 242 |
] |
| 243 |
|
| 244 |
# The name of an image file (relative to this directory) to place at the top of |
| 245 |
# the title page. |
| 246 |
#latex_logo = None |
| 247 |
|
| 248 |
# For "manual" documents, if this is true, then toplevel headings are parts, |
| 249 |
# not chapters. |
| 250 |
#latex_use_parts = False |
| 251 |
|
| 252 |
# Additional stuff for the LaTeX preamble. |
| 253 |
LATEX_PREAMBLE=r""" |
| 254 |
\renewcommand{\AA}{\text{\r{A}}} % Allow \AA in math mode |
| 255 |
\usepackage[utf8]{inputenc} % Allow unicode symbols in text |
| 256 |
\ifdefined\DeclareUnicodeCharacter |
| 257 |
\DeclareUnicodeCharacter{00B7}{\ensuremath{\cdot}} % cdot |
| 258 |
\DeclareUnicodeCharacter{00B0}{\ensuremath{^\circ}} % degrees |
| 259 |
\DeclareUnicodeCharacter{212B}{\AA} % Angstrom |
| 260 |
\else |
| 261 |
% substitute workaround for missing unicode characters (see conf.py) |
| 262 |
\fi |
| 263 |
""" |
| 264 |
# Note: When building with unicode-aware latex program tectonic some |
| 265 |
# characters are not showing up in the pdf, with errors like the following: |
| 266 |
# |
| 267 |
# warning: could not represent character "Å" in font "ptmr8t" |
| 268 |
# |
| 269 |
# This is true for the following characters: |
| 270 |
# |
| 271 |
# … = \ldots (ellipsis) |
| 272 |
# ’ = ' (close single) |
| 273 |
# “ = `` (open double) |
| 274 |
# Å = \r{A} (Angstrom) |
| 275 |
# |
| 276 |
# The following do not appear even though they might be expected to: |
| 277 |
# |
| 278 |
# · = \cdot (center dot) |
| 279 |
# ° = ^\circ (degrees) |
| 280 |
# |
| 281 |
# Attempted workaround failed: |
| 282 |
# |
| 283 |
# \catcode`\Å=\active |
| 284 |
# \def Å{\AA}% |
| 285 |
# |
| 286 |
latex_elements = {'preamble' : LATEX_PREAMBLE} |
| 287 |
|
| 288 |
# Documents to append as an appendix to all manuals. |
| 289 |
#latex_appendices = [] |
| 290 |
|
| 291 |
# If false, no module index is generated. |
| 292 |
#latex_use_modindex = True |
| 293 |
|
| 294 |
# Which class/__init__ docstring to use: class, init, or both |
| 295 |
autoclass_content = 'both' |
| 296 |
|
| 297 |
# Autodoc member sort order: by class or by type |
| 298 |
autodoc_member_order = 'groupwise' |
| 299 |
|
| 300 |
if os.path.exists('rst_prolog'): |
| 301 |
with io.open('rst_prolog', encoding='utf-8') as fid: |
| 302 |
rst_prolog = fid.read() |
| 303 |
|