Skip to content

Commit 8ea3ff5

Browse files
committed
First version of the theme - works locally.
1 parent c17790d commit 8ea3ff5

21 files changed

+1169
-1
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Dask is a community maintained project. We welcome contributions in the form of bug reports, documentation, code, design proposals, and more.
2+
3+
For general information on how to contribute see https://docs.dask.org/en/latest/develop.html.
4+
5+
Installing the theme itself:
6+
7+
After following the contribution guidelines in the dask docs, you will still need to install the theme itself to see the chnages you made. At the root level of the repository run:
8+
9+
`python -m pip install -e .`
10+
11+
After that you will be able to build the docs locally by doing `make html` in the `docs` directory.

LICENSE.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2021 Matplotlib Developers
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification,
5+
are permitted provided that the following conditions are met:
6+
7+
Redistributions of source code must retain the above copyright notice,
8+
this list of conditions and the following disclaimer.
9+
10+
Redistributions in binary form must reproduce the above copyright notice,
11+
this list of conditions and the following disclaimer in the documentation
12+
and/or other materials provided with the distribution.
13+
14+
Neither the name of Anaconda nor the names of any contributors may be used to
15+
endorse or promote products derived from this software without specific prior
16+
written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28+
THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
recursive-include mpl_sphinx_theme *.py
2+
recursive-include mpl_sphinx_theme *.html
3+
recursive-include mpl_sphinx_theme *.css
4+
recursive-include mpl_sphinx_theme *.svg
5+
recursive-include mpl_sphinx_theme *.png
6+
recursive-include mpl_sphinx_theme *.ico
7+
recursive-include mpl_sphinx_theme *.conf
8+
9+
include setup.py
10+
include requirements.txt
11+
include README.rst
12+
include LICENSE.txt
13+
include MANIFEST.in

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Dask Sphinx Theme
2+
=================
3+
4+
This is the official Sphinx theme for Dask documentation. It extends the
5+
``sphinx-book-theme`` project, but adds custom styling and a navigation bar to
6+
additional Dask subprojects.
7+
8+
When creating a Dask subproject you can include this theme by changing this
9+
line in your conf.py file
10+
11+
.. code-block:: python
12+
13+
html_theme = 'dask_sphinx_theme'
14+
15+
And by including ``dask_sphinx_theme`` as a requirement in your documentation
16+
installation.
17+
18+
Releasing
19+
---------
20+
21+
This project `uses GitHub Actions <https://github.com/dask/dask-sphinx-theme/blob/main/.github/workflows/publish-pypi.yml>`_
22+
to automatically push a new release to PyPI whenever
23+
a git tag is pushed. For example, to release a new ``x.y.z`` version of
24+
``dask-sphinx-theme``, checkout the commit you would like to release,
25+
add a git tag, and push the tag to the ``main`` branch of the
26+
``dask/dask-sphinx-theme`` repository:
27+
28+
.. code-block::
29+
30+
$ git checkout <commit-hash>
31+
$ git tag -a x.y.z -m 'Version x.y.z'
32+
$ git push upstream main --tags
33+
34+
After a new release is published on PyPI, a pull request to the ``dask-sphinx-theme``
35+
`conda-forge feedstock <https://github.com/conda-forge/dask-sphinx-theme-feedstock>`_
36+
for the new ``x.y.z`` release will automatically be opened by conda-forge bots.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?= "-vv"
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Configuration file for the Sphinx documentation builder for
2+
# matplotlib projects.
3+
4+
# Release mode enables optimizations and other related options.
5+
is_release_build = tags.has('release') # noqa
6+
7+
# -- Project information -----------------------------------------------------
8+
9+
project = "Matplotlib Sphinx Theme"
10+
copyright = "2021, Matplotlib Contributors"
11+
author = "Matplotlib Contributors"
12+
13+
14+
# -- General configuration ---------------------------------------------------
15+
16+
# Add any Sphinx extension module names here, as strings. They can be
17+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
18+
# ones.
19+
extensions = []
20+
21+
# Add any paths that contain templates here, relative to this directory.
22+
23+
# List of patterns, relative to source directory, that match files and
24+
# directories to ignore when looking for source files.
25+
# This pattern also affects html_static_path and html_extra_path.
26+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
27+
28+
# -- Options for HTML output -------------------------------------------------
29+
30+
html_theme = "mpl_sphinx_theme"
31+
html_logo = "_static/logo2.svg"
32+
html_favicon = "_static/favicon.ico"
33+
html_theme_options = {
34+
"logo_link": "https://matplotlib.org/stable/",
35+
# collapse_navigation in pydata-sphinx-theme is slow, so skipped for local
36+
# and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
37+
"collapse_navigation": not is_release_build,
38+
"icon_links": [
39+
{
40+
"name": "gitter",
41+
"url": "https://gitter.im/matplotlib",
42+
"icon": "fab fa-gitter",
43+
},
44+
{
45+
"name": "discourse",
46+
"url": "https://discourse.matplotlib.org",
47+
"icon": "fab fa-discourse",
48+
},
49+
{
50+
"name": "GitHub",
51+
"url": "https://github.com/matplotlib/matplotlib",
52+
"icon": "fab fa-github-square",
53+
},
54+
{
55+
"name": "twitter",
56+
"url": "https://twitter.com/matplotlib/",
57+
"icon": "fab fa-twitter-square",
58+
},
59+
],
60+
"show_prev_next": False,
61+
"navbar_center": ["mpl_nav_bar.html"],
62+
}
63+
64+
# Add any paths that contain custom static files (such as style sheets) here,
65+
# relative to this directory. They are copied after the builtin static files,
66+
# so a file named "default.css" will overwrite the builtin "default.css".
67+
# html_static_path = ["static"]

docs/index.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Welcome to Matplotlib Sphinx Theme's documentation!
2+
===================================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Contents:
7+
8+
This is the official Sphinx theme for Matplotlib documentation.
9+
It extends the ``pydata_sphinx_theme`` project, but adds custom
10+
styling and a navigation bar.
11+
12+
When creating a Matplotlib subproject you can include this theme by changing this
13+
line in your conf.py file
14+
15+
.. code-block:: python
16+
17+
html_theme = 'mpl_sphinx_theme'
18+
19+
And by including ``mpl_sphinx_theme`` as a requirement in your documentation
20+
installation.
21+
22+
Note that the theme does not currently install the `logo2.svg` or
23+
the `favicon.ico`. You shoudl copy those from `docs/_static` to
24+
the local project `docs/_static`.
25+
26+
The full ``conf.py`` is
27+
28+
.. literalinclude:: conf.py

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

lighthouserc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"ci": {
3+
"assert": {
4+
"assertions": {
5+
"categories:performance": ["warn", { "minScore": 0.9 }],
6+
"categories:accessibility": ["warn", { "minScore": 1 }],
7+
"uses-long-cache-ttl": "off",
8+
"uses-http2": "off"
9+
}
10+
},
11+
"collect": {
12+
"staticDistDir": "./docs/_build/html"
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)