Skip to content

Commit df21983

Browse files
committed
DOC: use the new scipy-sphinx-theme in the documentation
1 parent 756dad2 commit df21983

File tree

7 files changed

+42
-240
lines changed

7 files changed

+42
-240
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "doc/scipy-sphinx-theme"]
2+
path = doc/scipy-sphinx-theme
3+
url = https://github.com/scipy/scipy-sphinx-theme.git

doc/scipy-sphinx-theme

Submodule scipy-sphinx-theme added at 65c59fe

doc/source/_static/scipy.css

-189
This file was deleted.
-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<h3>Resources</h3>
22
<ul>
33
<li><a href="http://scipy.org/">Scipy.org website</a></li>
4-
<li>&nbsp;</li>
54
</ul>

doc/source/_templates/layout.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{% extends "!layout.html" %}
2+
23
{% block rootrellink %}
3-
<li><a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}</li>
4+
{% if pagename != 'index' %}
5+
<li class="active"><a href="{{ pathto('index') }}">{{ shorttitle|e }}</a></li>
6+
{% endif %}
47
{% endblock %}
58

69
{% block sidebarsearch %}

doc/source/conf.py

+34-49
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
# The suffix of source filenames.
3131
source_suffix = '.rst'
3232

33-
# The master toctree document.
34-
#master_doc = 'index'
35-
3633
# General substitutions.
3734
project = 'NumPy'
3835
copyright = '2008-2009, The Scipy community'
@@ -83,62 +80,50 @@
8380
# HTML output
8481
# -----------------------------------------------------------------------------
8582

86-
# The style sheet to use for HTML and HTML Help pages. A file of that name
87-
# must exist either in Sphinx' static/ path, or in one of the custom paths
88-
# given in html_static_path.
89-
html_style = 'scipy.css'
90-
91-
# The name for this set of Sphinx documents. If None, it defaults to
92-
# "<project> v<release> documentation".
93-
html_title = "%s v%s Manual (DRAFT)" % (project, version)
83+
themedir = os.path.join(os.pardir, 'scipy-sphinx-theme', '_theme')
84+
if not os.path.isdir(themedir):
85+
raise RuntimeError("Get the scipy-sphinx-theme first, "
86+
"via git submodule init && git submodule update")
87+
88+
html_theme = 'scipy'
89+
html_theme_path = [themedir]
90+
91+
if 'scipyorg' in tags:
92+
# Build for the scipy.org website
93+
html_theme_options = {
94+
"edit_link": True,
95+
"sidebar": "right",
96+
"scipy_org_logo": True,
97+
"rootlinks": [("http://scipy.org/", "Scipy.org"),
98+
("http://docs.scipy.org/", "Docs")]
99+
}
100+
else:
101+
# Default build
102+
html_theme_options = {
103+
"edit_link": False,
104+
"sidebar": "left",
105+
"scipy_org_logo": False,
106+
"rootlinks": []
107+
}
108+
html_sidebars = {'index': 'indexsidebar.html'}
94109

95-
# The name of an image file (within the static path) to place at the top of
96-
# the sidebar.
97-
html_logo = 'scipyshiny_small.png'
110+
html_additional_pages = {
111+
'index': 'indexcontent.html',
112+
}
98113

99-
# Add any paths that contain custom static files (such as style sheets) here,
100-
# relative to this directory. They are copied after the builtin static files,
101-
# so a file named "default.css" will overwrite the builtin "default.css".
114+
html_title = "%s v%s Manual" % (project, version)
102115
html_static_path = ['_static']
103-
104-
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
105-
# using the given strftime format.
106116
html_last_updated_fmt = '%b %d, %Y'
107117

108-
# If true, SmartyPants will be used to convert quotes and dashes to
109-
# typographically correct entities.
110-
#html_use_smartypants = True
111-
112-
# Custom sidebar templates, maps document names to template names.
113-
html_sidebars = {
114-
'index': 'indexsidebar.html'
115-
}
116-
117-
# Additional templates that should be rendered to pages, maps page names to
118-
# template names.
119-
html_additional_pages = {
120-
'index': 'indexcontent.html',
121-
}
122-
123-
# If false, no module index is generated.
118+
html_use_modindex = True
119+
html_copy_source = False
124120
html_domain_indices = False
121+
html_file_suffix = '.html'
125122

126-
# If true, the reST sources are included in the HTML build as _sources/<name>.
127-
#html_copy_source = True
128-
129-
# If true, an OpenSearch description file will be output, and all pages will
130-
# contain a <link> tag referring to it. The value of this option must be the
131-
# base URL from which the finished HTML is served.
132-
#html_use_opensearch = ''
133-
134-
# If nonempty, this is the file name suffix for HTML files (e.g. ".html").
135-
#html_file_suffix = '.html'
136-
137-
# Output file base name for HTML help builder.
138123
htmlhelp_basename = 'numpy'
139124

140-
# Pngmath should try to align formulas properly
141125
pngmath_use_preview = True
126+
pngmath_dvipng_args = ['-gamma', '1.5', '-D', '96', '-bg', 'Transparent']
142127

143128

144129
# -----------------------------------------------------------------------------

doc/source/scipyshiny_small.png

-18.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)