|
1 | 1 | # -*- coding: utf-8 -*- |
2 | | -# |
3 | | -# Sphinx RTD theme demo documentation build configuration file, created by |
4 | | -# sphinx-quickstart on Sun Nov 3 11:56:36 2013. |
5 | | -# |
6 | | -# This file is executed 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 | 2 |
|
14 | 3 | import sys |
15 | 4 | import os |
16 | | - |
| 5 | +import re |
17 | 6 |
|
18 | 7 | sys.path.append(os.path.abspath('..')) |
19 | 8 | sys.path.append(os.path.abspath('./demo/')) |
20 | 9 |
|
21 | | -from sphinx_rtd_theme import __version__ |
| 10 | +from sphinx.locale import _ |
22 | 11 |
|
23 | | -# If extensions (or modules to document with autodoc) are in another directory, |
24 | | -# add these directories to sys.path here. If the directory is relative to the |
25 | | -# documentation root, use os.path.abspath to make it absolute, like shown here. |
26 | | -#sys.path.insert(0, os.path.abspath('.')) |
| 12 | +from sphinx_rtd_theme import __version__ |
27 | 13 |
|
28 | | -# -- General configuration ----------------------------------------------------- |
29 | 14 |
|
30 | | -# If your documentation needs a minimal Sphinx version, state it here. |
31 | | -#needs_sphinx = '1.0' |
| 15 | +project = u'Read the Docs Sphinx Theme' |
| 16 | +slug = re.sub(r'\W+', '-', project.lower()) |
| 17 | +version = __version__ |
| 18 | +release = __version__ |
| 19 | +author = u'Dave Snider, Read the Docs, Inc. & contributors' |
| 20 | +copyright = author |
| 21 | +language = 'en' |
32 | 22 |
|
33 | | -# Add any Sphinx extension module names here, as strings. They can be extensions |
34 | | -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. |
35 | 23 | extensions = [ |
36 | 24 | 'sphinx.ext.intersphinx', |
37 | 25 | 'sphinx.ext.autodoc', |
|
41 | 29 | 'sphinx_rtd_theme', |
42 | 30 | ] |
43 | 31 |
|
44 | | -# Do not warn about external images (status badges in README.rst) |
45 | | -suppress_warnings = ['image.nonlocal_uri'] |
46 | | - |
47 | | -# Add any paths that contain templates here, relative to this directory. |
48 | 32 | templates_path = ['_templates'] |
49 | | - |
50 | | -# The suffix of source filenames. |
51 | 33 | source_suffix = '.rst' |
52 | | - |
53 | | -# The encoding of source files. |
54 | | -#source_encoding = 'utf-8-sig' |
55 | | - |
56 | | -# The master toctree document. |
57 | | -master_doc = 'index' |
58 | | - |
59 | | -# General information about the project. |
60 | | -project = u'Read the Docs Sphinx Theme' |
61 | | -copyright = u'Dave Snider, Read the Docs, Inc. & contributors' |
62 | | - |
63 | | -# The version info for the project you're documenting, acts as replacement for |
64 | | -# |version| and |release|, also used in various other places throughout the |
65 | | -# built documents. |
66 | | -# |
67 | | -# The short X.Y version. |
68 | | -version = __version__ |
69 | | -# The full version, including alpha/beta/rc tags. |
70 | | -release = __version__ |
71 | | - |
72 | | -# The language for content autogenerated by Sphinx. Refer to documentation |
73 | | -# for a list of supported languages. |
74 | | -language = 'en' |
75 | | - |
76 | | -# There are two options for replacing |today|: either, you set today to some |
77 | | -# non-false value, then it is used: |
78 | | -#today = '' |
79 | | -# Else, today_fmt is used as the format for a strftime call. |
80 | | -#today_fmt = '%B %d, %Y' |
81 | | - |
82 | | -# List of patterns, relative to source directory, that match files and |
83 | | -# directories to ignore when looking for source files. |
84 | 34 | exclude_patterns = [] |
85 | 35 |
|
86 | | -# The reST default role (used for this markup: `text`) to use for all documents. |
87 | | -#default_role = None |
88 | | - |
89 | | -# If true, '()' will be appended to :func: etc. cross-reference text. |
90 | | -#add_function_parentheses = True |
91 | | - |
92 | | -# If true, the current module name will be prepended to all description |
93 | | -# unit titles (such as .. function::). |
94 | | -#add_module_names = True |
95 | | - |
96 | | -# If true, sectionauthor and moduleauthor directives will be shown in the |
97 | | -# output. They are ignored by default. |
98 | | -#show_authors = False |
99 | | - |
100 | | -# The name of the Pygments (syntax highlighting) style to use. |
| 36 | +master_doc = 'index' |
| 37 | +suppress_warnings = ['image.nonlocal_uri'] |
101 | 38 | pygments_style = 'default' |
102 | 39 |
|
103 | | -# A list of ignored prefixes for module index sorting. |
104 | | -#modindex_common_prefix = [] |
105 | | - |
106 | | -intersphinx_mapping = {'rtd': ('https://docs.readthedocs.io/en/latest/', None)} |
107 | | - |
108 | | - |
109 | | -# -- Options for HTML output --------------------------------------------------- |
| 40 | +intersphinx_mapping = { |
| 41 | + 'rtd': ('https://docs.readthedocs.io/en/latest/', None), |
| 42 | + 'sphinx': ('http://www.sphinx-doc.org/en/stable/', None), |
| 43 | +} |
110 | 44 |
|
111 | | -# The theme to use for HTML and HTML Help pages. See the documentation for |
112 | | -# a list of builtin themes. |
113 | 45 | html_theme = 'sphinx_rtd_theme' |
114 | | - |
115 | | -# Theme options are theme-specific and customize the look and feel of a theme |
116 | | -# further. For a list of options available for each theme, see the |
117 | | -# documentation. |
118 | 46 | html_theme_options = { |
119 | 47 | 'logo_only': True |
120 | 48 | } |
121 | | - |
122 | | -# Add any paths that contain custom themes here, relative to this directory. |
123 | 49 | html_theme_path = ["../.."] |
124 | | - |
125 | | -# The name for this set of Sphinx documents. If None, it defaults to |
126 | | -# "<project> v<release> documentation". |
127 | | -#html_title = None |
128 | | - |
129 | | -# A shorter title for the navigation bar. Default is the same as html_title. |
130 | | -#html_short_title = None |
131 | | - |
132 | | -# The name of an image file (relative to this directory) to place at the top |
133 | | -# of the sidebar. |
134 | 50 | html_logo = "demo/static/logo-wordmark-light.svg" |
135 | | - |
136 | | -# The name of an image file (within the static path) to use as favicon of the |
137 | | -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
138 | | -# pixels large. |
139 | | -#html_favicon = None |
140 | | - |
141 | | -# Add any paths that contain custom static files (such as style sheets) here, |
142 | | -# relative to this directory. They are copied after the builtin static files, |
143 | | -# so a file named "default.css" will overwrite the builtin "default.css". |
144 | | -#html_static_path = ['_static'] |
145 | | - |
146 | | -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, |
147 | | -# using the given strftime format. |
148 | | -#html_last_updated_fmt = '%b %d, %Y' |
149 | | - |
150 | | -# If true, SmartyPants will be used to convert quotes and dashes to |
151 | | -# typographically correct entities. |
152 | | -#html_use_smartypants = True |
153 | | - |
154 | | -# Custom sidebar templates, maps document names to template names. |
155 | | -#html_sidebars = {} |
156 | | - |
157 | | -# Additional templates that should be rendered to pages, maps page names to |
158 | | -# template names. |
159 | | -#html_additional_pages = {} |
160 | | - |
161 | | -# If false, no module index is generated. |
162 | | -#html_domain_indices = True |
163 | | - |
164 | | -# If false, no index is generated. |
165 | | -#html_use_index = True |
166 | | - |
167 | | -# If true, the index is split into individual pages for each letter. |
168 | | -#html_split_index = False |
169 | | - |
170 | | -# If true, links to the reST sources are added to the pages. |
171 | 51 | html_show_sourcelink = True |
172 | 52 |
|
173 | | -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
174 | | -#html_show_sphinx = True |
175 | | - |
176 | | -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
177 | | -#html_show_copyright = True |
178 | | - |
179 | | -# If true, an OpenSearch description file will be output, and all pages will |
180 | | -# contain a <link> tag referring to it. The value of this option must be the |
181 | | -# base URL from which the finished HTML is served. |
182 | | -#html_use_opensearch = '' |
183 | | - |
184 | | -# This is the file name suffix for HTML files (e.g. ".xhtml"). |
185 | | -#html_file_suffix = None |
186 | | - |
187 | | -# Output file base name for HTML help builder. |
188 | | -htmlhelp_basename = 'SphinxRTDthemedemodoc' |
189 | | - |
| 53 | +htmlhelp_basename = slug |
190 | 54 |
|
191 | | -# -- Options for LaTeX output -------------------------------------------------- |
192 | | - |
193 | | -latex_elements = { |
194 | | -# The paper size ('letterpaper' or 'a4paper'). |
195 | | -#'papersize': 'letterpaper', |
196 | | - |
197 | | -# The font size ('10pt', '11pt' or '12pt'). |
198 | | -#'pointsize': '10pt', |
199 | | - |
200 | | -# Additional stuff for the LaTeX preamble. |
201 | | -#'preamble': '', |
202 | | -} |
203 | | - |
204 | | -# Grouping the document tree into LaTeX files. List of tuples |
205 | | -# (source start file, target name, title, author, documentclass [howto/manual]). |
206 | 55 | latex_documents = [ |
207 | | - ('index', 'SphinxRTDthemedemo.tex', u'Sphinx RTD theme demo Documentation', |
208 | | - u'Dave Snider, Read the Docs, Inc. & contributors', 'manual'), |
| 56 | + ('index', '{0}.tex'.format(slug), project, author, 'manual'), |
209 | 57 | ] |
210 | 58 |
|
211 | | -# The name of an image file (relative to this directory) to place at the top of |
212 | | -# the title page. |
213 | | -#latex_logo = None |
214 | | - |
215 | | -# For "manual" documents, if this is true, then toplevel headings are parts, |
216 | | -# not chapters. |
217 | | -#latex_use_parts = False |
218 | | - |
219 | | -# If true, show page references after internal links. |
220 | | -#latex_show_pagerefs = False |
221 | | - |
222 | | -# If true, show URL addresses after external links. |
223 | | -#latex_show_urls = False |
224 | | - |
225 | | -# Documents to append as an appendix to all manuals. |
226 | | -#latex_appendices = [] |
227 | | - |
228 | | -# If false, no module index is generated. |
229 | | -#latex_domain_indices = True |
230 | | - |
231 | | - |
232 | | -# -- Options for manual page output -------------------------------------------- |
233 | | - |
234 | | -# One entry per manual page. List of tuples |
235 | | -# (source start file, name, description, authors, manual section). |
236 | 59 | man_pages = [ |
237 | | - ('index', 'sphinxrtdthemedemo', u'Sphinx RTD theme demo Documentation', |
238 | | - [u'Dave Snider, Read the Docs, Inc. & contributors'], 1) |
| 60 | + ('index', slug, project, [author], 1) |
239 | 61 | ] |
240 | 62 |
|
241 | | -# If true, show URL addresses after external links. |
242 | | -#man_show_urls = False |
243 | | - |
244 | | - |
245 | | -# -- Options for Texinfo output ------------------------------------------------ |
246 | | - |
247 | | -# Grouping the document tree into Texinfo files. List of tuples |
248 | | -# (source start file, target name, title, author, |
249 | | -# dir menu entry, description, category) |
250 | 63 | texinfo_documents = [ |
251 | | - ('index', 'SphinxRTDthemedemo', u'Sphinx RTD theme demo Documentation', |
252 | | - u'Dave Snider, Read the Docs, Inc. & contributors', 'SphinxRTDthemedemo', |
253 | | - 'One line description of project.', 'Miscellaneous'), |
| 64 | + ('index', slug, project, author, slug, project, 'Miscellaneous'), |
254 | 65 | ] |
255 | 66 |
|
256 | | -# Documents to append as an appendix to all manuals. |
257 | | -#texinfo_appendices = [] |
258 | | - |
259 | | -# If false, no module index is generated. |
260 | | -#texinfo_domain_indices = True |
261 | 67 |
|
262 | | -# How to display URL addresses: 'footnote', 'no', or 'inline'. |
263 | | -#texinfo_show_urls = 'footnote' |
| 68 | +# Extensions to theme docs |
| 69 | +def setup(app): |
| 70 | + from sphinx.domains.python import PyField |
| 71 | + from sphinx.util.docfields import Field |
| 72 | + |
| 73 | + app.add_object_type( |
| 74 | + 'confval', |
| 75 | + 'confval', |
| 76 | + objname='configuration value', |
| 77 | + indextemplate='pair: %s; configuration value', |
| 78 | + doc_field_types=[ |
| 79 | + PyField( |
| 80 | + 'type', |
| 81 | + label=_('Type'), |
| 82 | + has_arg=False, |
| 83 | + names=('type',), |
| 84 | + bodyrolename='class' |
| 85 | + ), |
| 86 | + Field( |
| 87 | + 'default', |
| 88 | + label=_('Default'), |
| 89 | + has_arg=False, |
| 90 | + names=('default',), |
| 91 | + ), |
| 92 | + ] |
| 93 | + ) |
0 commit comments