Skip to content

Commit 9b29830

Browse files
committed
docs/conf: cleanup
Signed-off-by: Unai Martinez-Corral <[email protected]>
1 parent 3ae21cf commit 9b29830

File tree

1 file changed

+14
-100
lines changed

1 file changed

+14
-100
lines changed

docs/conf.py

Lines changed: 14 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,53 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Project Trellis documentation build configuration file, created by
4-
# sphinx-quickstart on Mon Feb 5 11:04:37 2018.
5-
#
6-
# This file is execfile()d with the current directory set to its
7-
# containing dir.
8-
#
9-
# Note that not all possible configuration values are present in this
10-
# autogenerated file.
11-
#
12-
# All configuration values have a default; values that are commented out
13-
# serve to show the default.
3+
# Updated documentation of the configuration options is available at
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
145

15-
import re
6+
from re import sub as re_sub
7+
from os import environ, popen, path as os_path
8+
from sys import path as sys_path
169

17-
# Markdown support
18-
import recommonmark
10+
sys_path.insert(0, os_path.abspath('.'))
1911

20-
# If extensions (or modules to document with autodoc) are in another directory,
21-
# add these directories to sys.path here. If the directory is relative to the
22-
# documentation root, use os.path.abspath to make it absolute, like shown here.
23-
#
24-
import os
25-
import sys
26-
sys.path.insert(0, os.path.abspath('.'))
2712
from markdown_code_symlinks import MarkdownCodeSymlinks
2813

2914
# -- General configuration ------------------------------------------------
3015

31-
# If your documentation needs a minimal Sphinx version, state it here.
32-
#
33-
# needs_sphinx = '1.0'
16+
project = 'Project Trellis'
17+
author = 'Project Trellis Authors'
18+
copyright = f'2018, {author}'
3419

35-
# Add any Sphinx extension module names here, as strings. They can be
36-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
37-
# ones.
3820
extensions = [
3921
'sphinx.ext.imgmath', 'sphinx.ext.autodoc', 'sphinx.ext.doctest',
40-
'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.todo'
22+
'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.todo',
23+
'recommonmark'
4124
]
4225

43-
# Add any paths that contain templates here, relative to this directory.
4426
templates_path = ['_templates']
4527

46-
# The suffix(es) of source filenames.
47-
# You can specify multiple suffix as a list of string:
4828
source_suffix = ['.rst', '.md']
4929
source_parsers = {
5030
'.md': 'recommonmark.parser.CommonMarkParser',
5131
}
5232

53-
# The master toctree document.
5433
master_doc = 'index'
5534

56-
# General information about the project.
57-
project = u'Project Trellis'
58-
copyright = u'2018, SymbiFlow Team'
59-
author = u'SymbiFlow Team'
60-
61-
# The version info for the project you're documenting, acts as replacement for
62-
# |version| and |release|, also used in various other places throughout the
63-
# built documents.
64-
#
65-
# The full version, including alpha/beta/rc tags.
66-
release = re.sub('^v', '', os.popen('git describe ').read().strip())
67-
# The short X.Y version.
35+
release = re_sub('^v', '', popen('git describe ').read().strip())
6836
version = release
6937

70-
# The language for content autogenerated by Sphinx. Refer to documentation
71-
# for a list of supported languages.
72-
#
73-
# This is also used if you do content translation via gettext catalogs.
74-
# Usually you set "language" from the command line for these cases.
7538
language = None
7639

77-
# List of patterns, relative to source directory, that match files and
78-
# directories to ignore when looking for source files.
79-
# This patterns also effect to html_static_path and html_extra_path
8040
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
8141

82-
# The name of the Pygments (syntax highlighting) style to use.
8342
pygments_style = 'sphinx'
8443

85-
# If true, `todo` and `todoList` produce output, else they produce nothing.
8644
todo_include_todos = True
8745

8846
# -- Options for HTML output ----------------------------------------------
8947

90-
# The theme to use for HTML and HTML Help pages. See the documentation for
91-
# a list of builtin themes.
92-
#
9348
html_theme = 'sphinx_rtd_theme'
9449

95-
# Theme options are theme-specific and customize the look and feel of a theme
96-
# further. For a list of options available for each theme, see the
97-
# documentation.
98-
#
99-
# html_theme_options = {}
100-
101-
# Enable github links when not on readthedocs
102-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
50+
on_rtd = environ.get('READTHEDOCS', None) == 'True'
10351
if not on_rtd:
10452
html_context = {
10553
"display_github": True, # Integrate GitHub
@@ -109,16 +57,8 @@
10957
"conf_py_path": "/doc/",
11058
}
11159

112-
# Add any paths that contain custom static files (such as style sheets) here,
113-
# relative to this directory. They are copied after the builtin static files,
114-
# so a file named "default.css" will overwrite the builtin "default.css".
11560
html_static_path = ['_static']
11661

117-
# Custom sidebar templates, must be a dictionary that maps document names
118-
# to template names.
119-
#
120-
# This is required for the alabaster theme
121-
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
12262
html_sidebars = {
12363
'**': [
12464
'relations.html', # needs 'show_related': True theme option to display
@@ -128,32 +68,12 @@
12868

12969
# -- Options for HTMLHelp output ------------------------------------------
13070

131-
# Output file base name for HTML help builder.
13271
htmlhelp_basename = 'prjtrellis'
13372

13473
# -- Options for LaTeX output ---------------------------------------------
13574

136-
latex_elements = {
137-
# The paper size ('letterpaper' or 'a4paper').
138-
#
139-
# 'papersize': 'letterpaper',
140-
141-
# The font size ('10pt', '11pt' or '12pt').
142-
#
143-
# 'pointsize': '10pt',
144-
145-
# Additional stuff for the LaTeX preamble.
146-
#
147-
# 'preamble': '',
148-
149-
# Latex figure (float) alignment
150-
#
151-
# 'figure_align': 'htbp',
152-
}
75+
latex_elements = {}
15376

154-
# Grouping the document tree into LaTeX files. List of tuples
155-
# (source start file, target name, title,
156-
# author, documentclass [howto, manual, or own class]).
15777
latex_documents = [
15878
(
15979
master_doc, 'ProjectTrellis.tex', u'Project Trellis Documentation',
@@ -162,24 +82,18 @@
16282

16383
# -- Options for manual page output ---------------------------------------
16484

165-
# One entry per manual page. List of tuples
166-
# (source start file, name, description, authors, manual section).
16785
man_pages = [
16886
(master_doc, 'projecttrellis', u'Project Trellis Documentation', [author], 1)
16987
]
17088

17189
# -- Options for Texinfo output -------------------------------------------
17290

173-
# Grouping the document tree into Texinfo files. List of tuples
174-
# (source start file, target name, title, author,
175-
# dir menu entry, description, category)
17691
texinfo_documents = [
17792
(
17893
master_doc, 'ProjectTrellis', u'Project Trellis Documentation', author,
17994
'ProjectTrellis', 'One line description of project.', 'Miscellaneous'),
18095
]
18196

182-
# Example configuration for intersphinx: refer to the Python standard library.
18397
intersphinx_mapping = {'https://docs.python.org/': None}
18498

18599

0 commit comments

Comments
 (0)