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