Skip to content

Commit 42d0abe

Browse files
authored
Change the documentation theme to furo. (#53)
1 parent 01d7d3f commit 42d0abe

25 files changed

+285
-266
lines changed

README.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
.. image:: https://codecov.io/gh/pytask-dev/pytask/branch/main/graph/badge.svg
2222
:target: https://codecov.io/gh/pytask-dev/pytask
2323

24+
.. image:: https://results.pre-commit.ci/badge/github/pytask-dev/pytask/main.svg
25+
:target: https://results.pre-commit.ci/latest/github/pytask-dev/pytask/main
26+
:alt: pre-commit.ci status
27+
2428
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
2529
:target: https://github.com/psf/black
2630

@@ -31,8 +35,9 @@
3135
Features
3236
--------
3337

34-
In its highest aspirations, pytask tries to be pytest as a build system. Its features
35-
include:
38+
In its highest aspirations, pytask tries to be pytest as a build system. It's main
39+
purpose is to facilitate reproducible research by automating workflows in research
40+
projects. Its features include:
3641

3742
- **Automatic discovery of tasks.**
3843

@@ -57,11 +62,11 @@ explanations/why_do_i_need_a_build_system.html>`_ if you do not know or are not
5762
convinced that you need a build system.
5863

5964

60-
.. start-installation
61-
6265
Installation
6366
------------
6467

68+
.. start-installation
69+
6570
pytask is available on `Anaconda.org <https://anaconda.org/pytask/pytask>`_. Install the
6671
package with
6772

docs/_static/css/custom.css

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,12 @@ div.prompt {
33
display: none;
44
}
55

6-
/* Getting started index page */
7-
8-
/* Float four columns side by side */
9-
.column {
10-
float: left;
11-
width: 45%;
12-
padding: 10px 10px;
13-
}
14-
15-
/* Remove extra left and right margins, due to padding in columns */
16-
.row {margin: 0 -5px;}
17-
18-
/* Clear floats after the columns */
19-
.row:after {
20-
content: "";
21-
display: table;
22-
clear: both;
23-
}
24-
25-
/* Style the counter cards */
26-
.card {
27-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); /* this adds the "card" effect */
28-
padding: 16px;
29-
text-align: center;
30-
background-color: #fff;
31-
}
32-
33-
/* Responsive columns - one column layout (vertical) on small screens */
34-
@media screen and (max-width: 600px) {
35-
.column {
36-
width: 100%;
37-
display: block;
38-
margin-bottom: 20px;
39-
}
6+
img.card-img-top {
7+
height: 52px;
408
}
419

4210
a#index-link {
43-
color: #3E4349;
11+
color: #333;
4412
text-decoration: none;
4513
}
4614

docs/api.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
API Reference
2+
=============
3+
4+
The following documents are auto-generated and not carefully edited. They provide direct
5+
access to the source code and the docstrings.
6+
7+
.. toctree::
8+
:titlesonly:
9+
10+
/autoapi/pytask/index
11+
/autoapi/_pytask/index

docs/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ all releases are available on `Anaconda.org <https://anaconda.org/pytask/pytask>
1515
- :gh:`50` implements correct usage of singular and plural in collection logs.
1616
- :gh:`51` allows to invoke pytask through the Python interpreter with ``python -m
1717
pytask`` which will add the current path to ``sys.path``.
18+
- :gh:`53` changes the theme of the documentation to furo.
1819

1920

2021
0.0.10 - 2020-11-18

docs/conf.py

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"sphinx_copybutton",
4343
"sphinx_autodoc_typehints",
4444
"sphinx_click",
45+
"sphinx_panels",
4546
"autoapi.extension",
4647
]
4748

@@ -52,6 +53,9 @@
5253

5354
suppress_warnings = ["ref.python"]
5455

56+
pygments_style = "sphinx"
57+
pygments_dark_style = "monokai"
58+
5559
# -- Extensions configuration ----------------------------------------------------------
5660

5761
# Configuration for autodoc.
@@ -93,8 +97,7 @@
9397

9498
# The theme to use for HTML and HTML Help pages. See the documentation for a list of
9599
# built-in themes.
96-
97-
html_theme = "alabaster"
100+
html_theme = "furo"
98101

99102
# Add any paths that contain custom static files (such as style sheets) here, relative
100103
# to this directory. They are copied after the built-in static files, so a file named
@@ -103,19 +106,38 @@
103106

104107
# The name of an image file (within the static path) to use as favicon of the docs.
105108
# This file should be a Windows icon file (.ico) being 16x16 or 32x32 pixels large.
106-
html_favicon = "_static/images/pytask.ico" # noqa: E800
109+
html_logo = "_static/images/pytask_w_text.svg"
110+
111+
# The name of an image file (within the static path) to use as favicon of the docs.
112+
# This file should be a Windows icon file (.ico) being 16x16 or 32x32 pixels large.
113+
html_favicon = "_static/images/pytask.ico"
107114

115+
# Add any paths that contain custom static files (such as style sheets) here, relative
116+
# to this directory. They are copied after the builtin static files, so a file named
117+
# "default.css" will overwrite the builtin "default.css".
108118
html_static_path = ["_static"]
109119

120+
# If false, no module index is generated.
121+
html_domain_indices = True
122+
123+
# If false, no index is generated.
124+
html_use_index = True
125+
126+
# If true, the index is split into individual pages for each letter.
127+
html_split_index = False
128+
129+
# If true, links to the reST sources are added to the pages.
130+
html_show_sourcelink = False
131+
132+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
133+
html_show_sphinx = True
134+
135+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
136+
html_show_copyright = True
137+
110138
html_theme_options = {
111-
"extra_nav_links": {"On Github": "https://github.com/pytask-dev/pytask"},
112-
"logo": "images/pytask_w_text.svg",
113-
"logo_name": False,
114-
"github_button": False,
115-
"github_user": "pytask-dev",
116-
"github_repo": "pytask",
117-
"font_family": '"Avenir Next", Calibri, "PT Sans", sans-serif',
118-
"head_font_family": '"Avenir Next", Calibri, "PT Sans", sans-serif',
139+
"sidebar_hide_name": True,
140+
"navigation_with_keys": True,
119141
}
120142

121143

docs/explanations/design.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ Design
44
The design of pytask has some key objectives.
55

66
1. The interface must be simple, easy-to-learn, and may have synergies with pytest. It
7-
is important that even users without a strong background in computer science are able
8-
to use pytask.
7+
is important that even users without a strong background in computer science or
8+
programming are able to use pytask.
99

1010
2. pytask must be easily extensible via plugins. Developers of pytask are naturally
1111
unaware of all the possible applications of a build system. Thus, they must focus on
12-
the host application and the design of the entry-points. This will also reduce the
13-
amount of maintenance.
12+
the host application and the design of the entry-points.

docs/explanations/pluggy.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mechanism to achieve extensibility is called :term:`hooking`.
88

99
At certain points, pytask, or more generally the host, implements entry-points which are
1010
called hook specifications. At these entry-points the host sends a message to all
11-
plugins which use this entry-point. The recipient of the message is implemented by the
11+
plugins which target this entry-point. The recipient of the message is implemented by the
1212
plugin and called a hook implementation. The hook implementation receives the message
1313
and can decide whether to send a response or not. Then, the host receives the responses
1414
and can decide whether to process all or just the first valid return.
@@ -17,7 +17,7 @@ In contrast to some other mechanisms to change the behavior of a program (like m
1717
overriding, monkey patching), hooking excels at allowing multiple plugins to work
1818
alongside each other.
1919

20-
Thus, it is the host's responsibility to design the entry-points in such a way that
20+
It is the host's responsibility to design the entry-points in a way such that
2121

2222
- plugins can target very specific entry-points of the application and achieve their
2323
goal efficiently.
@@ -26,12 +26,13 @@ Thus, it is the host's responsibility to design the entry-points in such a way t
2626
the complexity of plugin's provided functionality.
2727

2828

29-
.. rubric:: References
29+
References
30+
----------
3031

3132
.. [1] `pluggy's documentation <https://pluggy.readthedocs.io/en/latest/>`_.
3233
3334
.. [2] `A talk by Floris Bruynooghe about pluggy and pytest
3435
<https://youtu.be/zZsNPDfOoHU>`_.
3536
3637
.. [3] `An introduction to pluggy by Kracekumar Ramaraju
37-
<https://kracekumar.com/post/build_plugins_with_pluggy>`
38+
<https://kracekumar.com/post/build_plugins_with_pluggy>`_.

docs/explanations/why_another_build_system.rst

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,54 @@ Why another build system?
22
=========================
33

44
There are a lot of build systems out there with existing communities who accumulated a
5-
lot of experience over time. So why go through the hassle of creating another build
6-
system?
5+
lot of experience over time. So why bother creating another build system?
76

87
pytask is created having a particular audience in mind. Many researchers are not
9-
computer scientists first, but acquired some programming skills throughout their
10-
careers. This means a build system must be extremely user-friendly or provide a `steep
11-
learning curve <https://english.stackexchange.com/a/6226>`_, because it is only a tool.
12-
Since pytask resembles pytest in some ways, users have an easier time switching to
13-
pytask and feel more comfortable.
8+
computer scientists first. Instead, they acquired some programming skills throughout
9+
their careers. Thus, a build system must be extremely user-friendly and provide a `steep
10+
learning curve <https://english.stackexchange.com/a/6226>`_. Since pytask resembles
11+
pytest in many ways, users have an easy time switching to pytask and feel more
12+
comfortable and empowered.
1413

15-
The second reason is that pytest seems to provide the ideal architecture for a build
16-
system. Its plugin-based design allows for customization at every level. A build system
17-
is a tool which can be deployed in many different environments whose requirements are
18-
not foreseeable by the developer. If it is easy for users / developers to write plugins
19-
which extend the functionality of pytask it is more valuable. If there is any question
20-
whether pytest's architecture is really suited for this, one should look at the success
21-
of pytest, its wide-spread adoption, and its over 800 plugins.
14+
pytask inherits many of pytest's best ideas. The most useful one is probably the debug
15+
mode which enables users to jump right into the code where the error happened. It
16+
shortens feedback loops, increases productivity, and facilitates error detection.
17+
18+
pytest provides the ideal architecture for a build system. Its plugin-based design
19+
allows for customization at every level. A build system is a tool which can be deployed
20+
in many different contexts whose requirements are not foreseeable by core developers.
21+
Thus, it is important to enable users and developers to adjust pytask to their needs.
22+
pytest with its 800+ plugins is a huge success story in this regard. In turn, pytask may
23+
attract many people from different backgrounds who contribute back to the main
24+
application and help the broader community.
2225

2326

2427
Alternatives
2528
------------
2629

27-
Here is a list of other build systems and their advantages and disadvantages compared to
28-
pytask. The list helps to define pytask's niche and to collect new ideas to improve
29-
pytask.
30+
There are some alternatives to pytask which are listed below. The short descriptions
31+
don't do them justice and you should check them out to see which build system is best
32+
for you.
33+
34+
Feel free to contribute to this list and add points which made you chose some build
35+
system over pytask. The list also serves as an inspiration for pytask to adopt features
36+
present in other build systems.
3037

3138

3239
`snakemake <https://github.com/snakemake/snakemake>`_
3340
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3441

3542
Pros
3643

37-
- Mature library.
38-
- Is the build system for some research projects.
44+
- Very mature library and probably the most adapted library in the realm of scientific
45+
workflow software.
3946
- Can scale to clusters and use Docker images.
4047
- Supports Python and R.
48+
- Automatic test case generation.
4149

4250
Cons
4351

52+
- No debug mode.
4453
- Need to learn snakemake's syntax which is a mixture of Make and Python.
4554
- Seems to have no plugin system.
4655

@@ -55,7 +64,7 @@ Pros
5564

5665
Cons
5766

58-
- Focus on compiling binaries.
67+
- Focus on compiling binaries, not research projects.
5968
- Bus factor of 1.
6069

6170

@@ -74,7 +83,7 @@ Derivatives:
7483

7584
Cons
7685

77-
- written in Go.
86+
- Written in Go.
7887

7988

8089
`Scons <https://github.com/SCons/scons>`_
@@ -99,4 +108,5 @@ Pros
99108
Cons
100109

101110
- Development is paused.
111+
- Designed for compiling software.
102112
- No plugin system, but extensible interfaces.

0 commit comments

Comments
 (0)