Skip to content

Commit 28c7018

Browse files
committed
Docs - default to sphinx_rtd_theme
following examples and conf.py from sphinx_rtd_theme itself
1 parent 7af5246 commit 28c7018

File tree

1 file changed

+18
-23
lines changed

1 file changed

+18
-23
lines changed

doc/conf.py

+18-23
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
extensions = [
3535
'nbsphinx',
3636
'sphinx.ext.mathjax',
37+
'sphinx_rtd_theme',
3738
]
39+
3840
# Add any paths that contain templates here, relative to this directory.
3941
templates_path = ['_templates']
4042

@@ -49,8 +51,9 @@
4951

5052
# General information about the project.
5153
project = u'ESP8266 Arduino Core'
52-
copyright = u'2017, Ivan Grokhotkov'
54+
slug = re.sub(r'\W+', '-', project.lower())
5355
author = u'Ivan Grokhotkov'
56+
copyright = author
5457

5558
# The version info for the project you're documenting, acts as replacement for
5659
# |version| and |release|, also used in various other places throughout the
@@ -71,7 +74,13 @@
7174
# List of patterns, relative to source directory, that match files and
7275
# directories to ignore when looking for source files.
7376
# This patterns also effect to html_static_path and html_extra_path
74-
exclude_patterns = ['_venv', '_build', 'Thumbs.db', '.DS_Store']
77+
exclude_patterns = [
78+
'_readthedocs',
79+
'_venv',
80+
'_build',
81+
'Thumbs.db',
82+
'.DS_Store',
83+
]
7584

7685
# The name of the Pygments (syntax highlighting) style to use.
7786
pygments_style = 'sphinx'
@@ -85,7 +94,7 @@
8594
# The theme to use for HTML and HTML Help pages. See the documentation for
8695
# a list of builtin themes.
8796
#
88-
html_theme = 'default'
97+
html_theme = 'sphinx_rtd_theme'
8998

9099
# Theme options are theme-specific and customize the look and feel of a theme
91100
# further. For a list of options available for each theme, see the
@@ -98,12 +107,12 @@
98107
# so a file named "default.css" will overwrite the builtin "default.css".
99108
html_static_path = ['_static']
100109

101-
102110
# -- Options for HTMLHelp output ------------------------------------------
103111

104-
# Output file base name for HTML help builder.
105-
htmlhelp_basename = 'ESP8266ArduinoCoredoc'
112+
html_show_sourcelink = True
106113

114+
# Output file base name for HTML help builder.
115+
htmlhelp_basename = slug
107116

108117
# -- Options for LaTeX output ---------------------------------------------
109118

@@ -129,8 +138,7 @@
129138
# (source start file, target name, title,
130139
# author, documentclass [howto, manual, or own class]).
131140
latex_documents = [
132-
(master_doc, 'ESP8266ArduinoCore.tex', u'ESP8266 Arduino Core Documentation',
133-
u'Ivan Grokhotkov', 'manual'),
141+
(master_doc, f'{slug}.tex', f'{project} Documentation', author, 'manual'),
134142
]
135143

136144

@@ -139,8 +147,7 @@
139147
# One entry per manual page. List of tuples
140148
# (source start file, name, description, authors, manual section).
141149
man_pages = [
142-
(master_doc, 'esp8266arduinocore', u'ESP8266 Arduino Core Documentation',
143-
[author], 1)
150+
(master_doc, slug, f'{project} Documentation', [author], 1)
144151
]
145152

146153

@@ -150,19 +157,7 @@
150157
# (source start file, target name, title, author,
151158
# dir menu entry, description, category)
152159
texinfo_documents = [
153-
(master_doc, 'ESP8266ArduinoCore', u'ESP8266 Arduino Core Documentation',
154-
author, 'ESP8266ArduinoCore', 'One line description of project.',
155-
'Miscellaneous'),
160+
(master_doc, slug, f'{project} Documentation', author, slug, project, 'Miscellaneous'),
156161
]
157162

158163
linkcheck_anchors_ignore = ["/#!"]
159-
160-
# -- Use sphinx_rtd_theme for local builds --------------------------------
161-
# ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
162-
#
163-
# on_rtd is whether we are on readthedocs.org
164-
env_readthedocs = os.environ.get('READTHEDOCS', None)
165-
166-
if not env_readthedocs: # only import and set the theme if we're building docs locally
167-
import sphinx_rtd_theme
168-
html_theme = 'sphinx_rtd_theme'

0 commit comments

Comments
 (0)