Skip to content

Commit 9c544e2

Browse files
committed
Use new templating blocks from git_helper for documentation, and added error page for notfound Sphinx extension
1 parent e04a611 commit 9c544e2

File tree

7 files changed

+187
-40
lines changed

7 files changed

+187
-40
lines changed

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ domdf_python_tools
1818
- |conda-version| |conda-platform|
1919
* - Other
2020
- |license| |language| |commits-since| |commits-latest| |maintained|
21-
21+
2222
.. |docs| image:: https://readthedocs.org/projects/domdf_python_tools/badge/?version=latest
2323
:target: https://domdf_python_tools.readthedocs.io/en/latest/?badge=latest
2424
:alt: Documentation Status
2525

2626
.. |travis| image:: https://img.shields.io/travis/com/domdfcoding/domdf_python_tools/master?logo=travis
2727
:target: https://travis-ci.com/domdfcoding/domdf_python_tools
2828
:alt: Travis Build Status
29-
29+
3030
.. |requires| image:: https://requires.io/github/domdfcoding/domdf_python_tools/requirements.svg?branch=master
3131
:target: https://requires.io/github/domdfcoding/domdf_python_tools/requirements/?branch=master
3232
:alt: Requirements Status
@@ -89,29 +89,29 @@ Helpful functions for Python
8989

9090
|
9191
92-
Installation
93-
--------------
92+
.. start installation
9493
9594
``domdf_python_tools`` can be installed from PyPI or Anaconda.
9695

9796
To install with ``pip``:
9897

9998
.. code-block:: bash
10099
101-
$ python -m pip install domdf_python_tools
100+
$ python -m pip install domdf_python_tools
102101
103102
To install with ``conda``:
104103

105-
* First add the required channels
104+
* First add the required channels
106105

107-
.. code-block:: bash
106+
.. code-block:: bash
108107
109-
$ conda config --add channels http://conda.anaconda.org/domdfcoding
110-
$ conda config --add channels http://conda.anaconda.org/conda-forge
108+
$ conda config --add channels http://conda.anaconda.org/domdfcoding
109+
$ conda config --add channels http://conda.anaconda.org/conda-forge
111110
112-
* Then install
111+
* Then install
113112

114-
.. code-block:: bash
113+
.. code-block:: bash
115114
116-
$ conda install domdf_python_tools
115+
$ conda install domdf_python_tools
117116
117+
.. end installation

__pkginfo__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
# This file is managed by `git_helper`. Don't edit it directly
2-
# Copyright (C) 2019-2020 Dominic Davis-Foster <[email protected]>
1+
# This file is managed by `git_helper`. Don't edit it directly
2+
# Copyright (C) 2020 Dominic Davis-Foster <[email protected]>
33
#
4-
# This program is free software: you can redistribute it and/or modify
5-
# it under the terms of the GNU General Public License as published by
6-
# the Free Software Foundation, either version 3 of the License, or
7-
# (at your option) any later version.
4+
# This file is distributed under the same license terms as the program it came with.
5+
# There will probably be a file called LICEN[S/C]E in the same directory as this file.
86
#
9-
# This program is distributed in the hope that it will be useful,
7+
# In any case, this program is distributed in the hope that it will be useful,
108
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
# GNU General Public License for more details.
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1310
#
14-
# You should have received a copy of the GNU General Public License
15-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
1711
# This script based on https://github.com/rocky/python-uncompyle6/blob/master/__pkginfo__.py
12+
#
1813

1914
import pathlib
2015

doc-source/404.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
:orphan:
2+
3+
===============
4+
404
5+
===============
6+
7+
We looked everywhere but we couldn't find that page!
8+
9+
.. image:: not-found.png
10+
:align: center
11+
12+
Try using the links in the sidebar to find what you are looking for.

doc-source/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@
4040
"sphinxcontrib.extras_require",
4141
"sphinx.ext.todo",
4242
"sphinxemoji.sphinxemoji",
43+
"notfound.extension",
44+
"sphinx_tabs.tabs",
45+
"sphinx-prompt",
4346
]
4447

4548
sphinxemoji_style = 'twemoji'

doc-source/index.rst

Lines changed: 150 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,158 @@
1-
.. include:: ../README.rst
1+
===========================
2+
domdf_python_tools
3+
===========================
24

5+
.. start short_desc
6+
7+
**Helpful functions for Python**
8+
9+
.. end short_desc
10+
11+
12+
.. start shields
13+
14+
.. list-table::
15+
:stub-columns: 1
16+
:widths: 10 90
17+
18+
* - Docs
19+
- |docs|
20+
* - Tests
21+
- |travis| |requires| |coveralls| |codefactor|
22+
* - PyPI
23+
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
24+
* - Anaconda
25+
- |conda-version| |conda-platform|
26+
* - Other
27+
- |license| |language| |commits-since| |commits-latest| |maintained|
28+
29+
.. |docs| image:: https://readthedocs.org/projects/domdf_python_tools/badge/?version=latest
30+
:target: https://domdf_python_tools.readthedocs.io/en/latest/?badge=latest
31+
:alt: Documentation Status
32+
33+
.. |travis| image:: https://img.shields.io/travis/com/domdfcoding/domdf_python_tools/master?logo=travis
34+
:target: https://travis-ci.com/domdfcoding/domdf_python_tools
35+
:alt: Travis Build Status
36+
37+
.. |requires| image:: https://requires.io/github/domdfcoding/domdf_python_tools/requirements.svg?branch=master
38+
:target: https://requires.io/github/domdfcoding/domdf_python_tools/requirements/?branch=master
39+
:alt: Requirements Status
40+
41+
.. |coveralls| image:: https://coveralls.io/repos/github/domdfcoding/domdf_python_tools/badge.svg?branch=master
42+
:target: https://coveralls.io/github/domdfcoding/domdf_python_tools?branch=master
43+
:alt: Coverage
44+
45+
.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/domdfcoding/domdf_python_tools
46+
:target: https://www.codefactor.io/repository/github/domdfcoding/domdf_python_tools
47+
:alt: CodeFactor Grade
48+
49+
.. |pypi-version| image:: https://img.shields.io/pypi/v/domdf_python_tools.svg
50+
:target: https://pypi.org/project/domdf_python_tools/
51+
:alt: PyPI - Package Version
52+
53+
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/domdf_python_tools.svg
54+
:target: https://pypi.org/project/domdf_python_tools/
55+
:alt: PyPI - Supported Python Versions
56+
57+
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/domdf_python_tools
58+
:target: https://pypi.org/project/domdf_python_tools/
59+
:alt: PyPI - Supported Implementations
60+
61+
.. |wheel| image:: https://img.shields.io/pypi/wheel/domdf_python_tools
62+
:target: https://pypi.org/project/domdf_python_tools/
63+
:alt: PyPI - Wheel
64+
65+
.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/domdf_python_tools
66+
:alt: Conda - Package Version
67+
:target: https://anaconda.org/domdfcoding/domdf_python_tools
68+
69+
.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/domdf_python_tools?label=conda%7Cplatform
70+
:alt: Conda - Platform
71+
:target: https://anaconda.org/domdfcoding/domdf_python_tools
72+
73+
.. |license| image:: https://img.shields.io/github/license/domdfcoding/domdf_python_tools
74+
:alt: License
75+
:target: https://github.com/domdfcoding/domdf_python_tools/blob/master/LICENSE
76+
77+
.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/domdf_python_tools
78+
:alt: GitHub top language
79+
80+
.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/domdf_python_tools/v0.3.3
81+
:target: https://github.com/domdfcoding/domdf_python_tools/pulse
82+
:alt: GitHub commits since tagged version
83+
84+
.. |commits-latest| image:: https://img.shields.io/github/last-commit/domdfcoding/domdf_python_tools
85+
:target: https://github.com/domdfcoding/domdf_python_tools/commit/master
86+
:alt: GitHub last commit
87+
88+
.. |maintained| image:: https://img.shields.io/maintenance/yes/2020
89+
:alt: Maintenance
90+
91+
.. end shields
92+
93+
94+
|
95+
96+
Installation
97+
-------------
98+
99+
.. start installation
100+
101+
.. tabs::
102+
103+
.. tab:: from PyPI
104+
105+
.. prompt:: bash
106+
107+
pip install domdf_python_tools
108+
109+
.. tab:: from Anaconda
110+
111+
First add the required channels
112+
113+
.. prompt:: bash
114+
115+
$ conda config --add channels http://conda.anaconda.org/domdfcoding
116+
$ conda config --add channels http://conda.anaconda.org/conda-forge
117+
118+
Then install
119+
120+
.. prompt:: bash
121+
122+
conda install domdf_python_tools
123+
124+
.. tab:: from GitHub
125+
126+
.. prompt:: bash
127+
128+
pip install git+https://github.com//domdf_python_tools@master
129+
130+
.. end installation
3131
4-
View the :ref:`Function Index <genindex>` or browse the `Source Code <_modules/index.html>`__.
5132
6-
`Browse the GitHub Repository <https://github.com/domdfcoding/domdf_python_tools>`__
7133
8134
.. toctree::
9-
:hidden:
135+
:hidden:
10136

11-
Home<self>
137+
Home<self>
12138

13139
.. toctree::
14-
:maxdepth: 3
15-
:caption: Documentation
16-
17-
dates
18-
doctools
19-
pagesizes
20-
paths
21-
terminal
22-
utils
23-
Source
24-
Building
140+
:maxdepth: 3
141+
:caption: Documentation
142+
143+
dates
144+
doctools
145+
pagesizes
146+
paths
147+
terminal
148+
utils
149+
Source
150+
Building
151+
152+
.. start links
153+
154+
View the :ref:`Function Index <genindex>` or browse the `Source Code <_modules/index.html>`__.
155+
156+
`Browse the GitHub Repository <https://github.com/domdfcoding/domdf_python_tools>`__
157+
158+
.. end links

doc-source/not-found.png

235 KB
Loading

doc-source/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ extras_require
22
pytz >=2019.1
33
sphinx >=3.0.3
44
sphinx-autodoc-typehints >=1.10.3
5+
sphinx-notfound-page
6+
sphinx-prompt >=1.2.0
7+
sphinx-tabs >=1.1.13
58
sphinx_rtd_theme
69
sphinxcontrib-httpdomain >=1.7.0
710
sphinxemoji >=0.1.6

0 commit comments

Comments
 (0)