Skip to content

DOC: Switch docs to pydata-sphinx-theme #313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ jobs:
name: Get dependencies and install
command: |
pip install --user -q --upgrade pip setuptools
pip install --user -q --upgrade numpy matplotlib sphinx
pip install --user -q --upgrade numpy matplotlib sphinx pydata-sphinx-theme
pip install --user -e .
git submodule init
git submodule update
- save_cache:
key: pip-cache
paths:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [Ubuntu]
python-version: [3.6, 3.7, 3.8, 3.9]
sphinx-version: ["sphinx==1.6.5", "sphinx==2.1", "sphinx>3.0"]
sphinx-version: ["sphinx==1.8.0", "sphinx==2.1", "sphinx>3.0"]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -53,8 +53,6 @@ jobs:

- name: Setup for doc build
run: |
# Get scipy-sphinx-theme
git submodule update --init
sudo apt install texlive texlive-latex-extra latexmk dvipng

- name: Build documentation
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "doc/scipy-sphinx-theme"]
path = doc/scipy-sphinx-theme
url = https://github.com/scipy/scipy-sphinx-theme
37 changes: 10 additions & 27 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', 'scipy-sphinx-theme']
exclude_patterns = ['_build']

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand Down Expand Up @@ -131,32 +131,15 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

themedir = os.path.join(os.path.dirname(__file__), 'scipy-sphinx-theme', '_theme')
if not os.path.isdir(themedir):
raise RuntimeError("Get the scipy-sphinx-theme first, "
"via git submodule init && git submodule update")

html_theme = 'scipy'
html_theme_path = [themedir]

if 'scipyorg' in tags: # noqa: F821
# Build for the scipy.org website
html_theme_options = {
"edit_link": True,
"sidebar": "right",
"scipy_org_logo": True,
"rootlinks": [("https://scipy.org/", "Scipy.org"),
("https://docs.scipy.org/", "Docs")]
}
else:
# Default build
html_theme_options = {
"edit_link": False,
"sidebar": "left",
"scipy_org_logo": False,
"rootlinks": []
}
html_sidebars = {}
html_theme = "pydata_sphinx_theme"
html_theme_options = {
"github_url": "https://github.com/numpy/numpydoc",
"show_prev_next": False,
"search_bar_position": "navbar",
}
html_sidebars = {
"**": [],
}

html_title = "%s v%s Manual" % (project, version)
html_last_updated_fmt = '%b %d, %Y'
Expand Down
1 change: 0 additions & 1 deletion doc/example.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

.. _example:

=======
Expand Down
11 changes: 4 additions & 7 deletions doc/format.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@

.. _format:

========================
numpydoc docstring guide
========================

.. Contents::
===========
Style guide
===========

This document describes the syntax and best practices for docstrings used with
the numpydoc extension for Sphinx_.
Expand Down Expand Up @@ -352,7 +349,7 @@ The sections of a function's docstring are:
code, possibly including a discussion of the algorithm. This
section may include mathematical equations, written in
`LaTeX <https://www.latex-project.org/>`_ format::

Notes
-----
The FFT is a fast implementation of the discrete Fourier transform:
Expand Down
9 changes: 3 additions & 6 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ Sphinx, and adds the code description directives ``np:function``,
- PyPI: https://pypi.python.org/pypi/numpydoc/


Documentation
=============

.. toctree::
:maxdepth: 2
:hidden:

install
release_notes
format
example
validation
release_notes
example
16 changes: 9 additions & 7 deletions doc/install.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
===============
Getting started
===============

============
Installation
============

This extension requires Python 3.5+, sphinx 1.6.5+ and is available from:
This extension requires Python 3.5+, sphinx 1.8+ and is available from:

* `numpydoc on PyPI <http://pypi.python.org/pypi/numpydoc>`_
* `numpydoc on GitHub <https://github.com/numpy/numpydoc/>`_

'numpydoc' should be added to the ``extensions`` option in your Sphinx
``conf.py``. (Note that `sphinx.ext.autosummary` will automatically be loaded
as well.)
`'numpydoc'` should be added to the ``extensions`` option in your Sphinx
``conf.py``. ``'sphinx.ext.autosummary'`` will automatically be loaded
as well.

Sphinx config options
=====================
Configuration
=============

The following options can be set in your Sphinx ``conf.py``:

Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy
matplotlib
pydata-sphinx-theme
1 change: 0 additions & 1 deletion doc/scipy-sphinx-theme
Submodule scipy-sphinx-theme deleted from bc3b4b
9 changes: 6 additions & 3 deletions doc/validation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
==============================
Validating NumpyDoc docstrings
==============================
==========
Validation
==========

Docstring Validation using Python
---------------------------------

To see the Restructured Text generated for an object, the ``numpydoc`` module
can be called. For example, to do it for ``numpy.ndarray``, use:
Expand Down