|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +"""Configuration file for the Sphinx documentation builder. |
| 3 | +
|
| 4 | +This file does only contain a selection of the most common options. For a |
| 5 | +full list see the documentation: |
| 6 | +
|
| 7 | +* http://www.sphinx-doc.org/en/stable/config |
| 8 | +
|
| 9 | +""" |
| 10 | + |
| 11 | +from __future__ import division, print_function, unicode_literals |
| 12 | + |
| 13 | +# from datetime import datetime |
| 14 | + |
| 15 | +from recommonmark.parser import CommonMarkParser |
| 16 | + |
| 17 | +# You should have received a copy of the GNU Affero General Public License |
| 18 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | +__author__ = 'Imran Iqbal' # noqa: E221 |
| 20 | +__copyright__ = 'Copyright (C) 2018, MYII' # noqa: E221 |
| 21 | +__license__ = 'Apache-2.0' # noqa: E221 |
| 22 | +__version__ = 'latest' # noqa: E221 |
| 23 | +__maintainer__ = 'Imran Iqbal' # noqa: E221 |
| 24 | + |
| 25 | + |
| 26 | +# -- Project information ----------------------------------------------------- |
| 27 | + |
| 28 | +project = u'template-formula' |
| 29 | +# copyright = str(datetime.now().year) |
| 30 | +copyright = __copyright__.replace('Copyright ', '').replace('(C) ', '') # noqa: A001 |
| 31 | +author = __author__ |
| 32 | +version = __version__ |
| 33 | +release = __version__ |
| 34 | + |
| 35 | + |
| 36 | +# -- General configuration --------------------------------------------------- |
| 37 | + |
| 38 | +# If your documentation needs a minimal Sphinx version, state it here. |
| 39 | +# |
| 40 | +# needs_sphinx = '1.0' |
| 41 | + |
| 42 | +# Add any Sphinx extension module names here, as strings. They can be |
| 43 | +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
| 44 | +# ones. |
| 45 | +extensions = [] |
| 46 | + |
| 47 | +# Add any paths that contain templates here, relative to this directory. |
| 48 | +templates_path = ['templates', '_templates', '.templates'] |
| 49 | + |
| 50 | +# The suffix(es) of source filenames. |
| 51 | +# You can specify multiple suffix as a list of string: |
| 52 | +# |
| 53 | +source_suffix = ['.rst', '.md'] |
| 54 | + |
| 55 | +# The master toctree document. |
| 56 | +master_doc = 'index' |
| 57 | + |
| 58 | +# The language for content autogenerated by Sphinx. Refer to documentation |
| 59 | +# for a list of supported languages. |
| 60 | +# |
| 61 | +# This is also used if you do content translation via gettext catalogs. |
| 62 | +# Usually you set "language" from the command line for these cases. |
| 63 | +language = None |
| 64 | + |
| 65 | +# List of patterns, relative to source directory, that match files and |
| 66 | +# directories to ignore when looking for source files. |
| 67 | +# This pattern also affects html_static_path and html_extra_path . |
| 68 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
| 69 | + |
| 70 | +# The name of the Pygments (syntax highlighting) style to use. |
| 71 | +pygments_style = 'sphinx' |
| 72 | + |
| 73 | + |
| 74 | +# -- Options for the reStructuredText parser --------------------------------- |
| 75 | + |
| 76 | +file_insertion_enabled = False |
| 77 | + |
| 78 | + |
| 79 | +# -- Options for HTML output ------------------------------------------------- |
| 80 | + |
| 81 | +# The theme to use for HTML and HTML Help pages. See the documentation for |
| 82 | +# a list of builtin themes. |
| 83 | +# |
| 84 | +html_theme = 'sphinx_rtd_theme' |
| 85 | + |
| 86 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 87 | +# further. For a list of options available for each theme, see the |
| 88 | +# documentation. |
| 89 | +# |
| 90 | +# html_theme_options = {} |
| 91 | + |
| 92 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 93 | +# relative to this directory. They are copied after the builtin static files, |
| 94 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 95 | +html_static_path = ['_static'] |
| 96 | + |
| 97 | +# Custom sidebar templates, must be a dictionary that maps document names |
| 98 | +# to template names. |
| 99 | +# |
| 100 | +# The default sidebars (for documents that don't match any pattern) are |
| 101 | +# defined by theme itself. Builtin themes are using these templates by |
| 102 | +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', |
| 103 | +# 'searchbox.html']``. |
| 104 | +# |
| 105 | +# html_sidebars = {} |
| 106 | + |
| 107 | + |
| 108 | +# -- Options for HTMLHelp output --------------------------------------------- |
| 109 | + |
| 110 | +# Output file base name for HTML help builder. |
| 111 | +htmlhelp_basename = 'template-formula' |
| 112 | + |
| 113 | + |
| 114 | +# -- Options for Markdown output --------------------------------------------- |
| 115 | + |
| 116 | +source_parsers = { |
| 117 | + '.md': CommonMarkParser, |
| 118 | +} |
| 119 | + |
| 120 | + |
| 121 | +# -- Options for LaTeX output ------------------------------------------------ |
| 122 | + |
| 123 | +latex_elements = { |
| 124 | + # The paper size ('letterpaper' or 'a4paper'). |
| 125 | + # |
| 126 | + # 'papersize': 'letterpaper', |
| 127 | + |
| 128 | + # The font size ('10pt', '11pt' or '12pt'). |
| 129 | + # |
| 130 | + # 'pointsize': '10pt', |
| 131 | + |
| 132 | + # Additional stuff for the LaTeX preamble. |
| 133 | + # |
| 134 | + # 'preamble': '', |
| 135 | + |
| 136 | + # Latex figure (float) alignment |
| 137 | + # |
| 138 | + # 'figure_align': 'htbp', |
| 139 | +} |
| 140 | + |
| 141 | +# Grouping the document tree into LaTeX files. List of tuples |
| 142 | +# (source start file, target name, title, |
| 143 | +# author, documentclass [howto, manual, or own class]). |
| 144 | +latex_documents = [ |
| 145 | + ( |
| 146 | + 'index', |
| 147 | + 'template-formula.tex', |
| 148 | + u'template-formula Documentation', |
| 149 | + u'', |
| 150 | + 'manual', |
| 151 | + ), |
| 152 | +] |
| 153 | + |
| 154 | + |
| 155 | +# -- Functions: `setup`, docstring preprocessing, etc. ----------------------- |
| 156 | + |
| 157 | +def setup(app): |
| 158 | + """Prepare the Sphinx application object. |
| 159 | +
|
| 160 | + Used for providing a custom CSS file for override styles. |
| 161 | +
|
| 162 | + Parameters |
| 163 | + ---------- |
| 164 | + app : object |
| 165 | + The Sphinx application object. |
| 166 | +
|
| 167 | + Returns |
| 168 | + ------- |
| 169 | + app : object |
| 170 | + The Sphinx application object. |
| 171 | +
|
| 172 | + """ |
| 173 | + app.add_stylesheet('css/custom.css') |
| 174 | + return app |
0 commit comments