Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24bcdfd

Browse files
committed
Improve semver documentation
* Remove Python2 * Use Roboto font family Sans: Roboto (for text) "Serif": Roboto Slab (for headings) Monospace: Roboto Mono (for code) * Improve CSS navigation * Create new logo and move it to docs/_static * Add new section about how to get the version of semver * Use a more general term (2.x.y) instead of specific versions * Number sections * Rework deps for doc build * Rework release procedure * Add sphinx-autodoc-typehints dependency for type hints
1 parent fe64de2 commit 24bcdfd

File tree

10 files changed

+195
-134
lines changed

10 files changed

+195
-134
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A Python module for `semantic versioning`_. Simplifies comparing versions.
1616
maintenance branch |MAINT|_.
1717

1818
The last version of semver which supports Python 2.7 to 3.5 will be
19-
2.11.x. However, keep in mind, version 2.11.x is frozen: no new
19+
2.x.y However, keep in mind, the major 2 release is frozen: no new
2020
features nor backports will be integrated.
2121

2222
We recommend to upgrade your workflow to Python 3.x to gain support,

docs/_static/css/custom.css

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
https://github.com/bitprophet/alabaster
3+
*/
4+
5+
/* Roboto (Sans), Roboto Slab ("serif"), Roboto Mono*/
6+
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,400;0,600;1,400&family=Roboto+Slab:wght@700&family=Roboto:ital@0;1&display=swap');
7+
8+
.logo {
9+
font-family: "Roboto Slab";
10+
}
11+
12+
img.logo {
13+
width: 80%;
14+
}
15+
16+
div.document {
17+
margin-top: 0pt;
18+
}
19+
20+
div.related.top {
21+
margin-top: -1em;
22+
}
23+
24+
div.related.top nav {
25+
margin-bottom: 0.5em;
26+
margin-top: 0.5em;
27+
}
28+
29+
.section h1 {
30+
font-weight: 700;
31+
}
32+
33+
.py.method {
34+
padding-top: 0.25em;
35+
padding-bottom: 1.25em;
36+
border-top: 1px solid #EEE;
37+
}
38+
39+
.py.function{
40+
padding-top: 1.25em;
41+
}
42+
43+
.related.bottom {
44+
margin-top: 1em;
45+
}
46+
47+
body {
48+
font-weight: 400;
49+
}
50+
51+
nav#rellinks {
52+
float: left;
53+
width: 100%;
54+
}
55+
56+
nav#rellinks li:first-child {
57+
float: left;
58+
text-align: left;
59+
width: 50%;
60+
}
61+
62+
nav#rellinks li:last-child {
63+
float: right;
64+
text-align: right;
65+
width: 50%;
66+
}
67+
68+
nav#rellinks li+li:before {
69+
content: "";
70+
}
71+
72+
div.related.top nav::after {
73+
float: none;
74+
}

docs/_static/css/semver.css

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/logo.svg renamed to docs/_static/logo.svg

Lines changed: 48 additions & 73 deletions
Loading

docs/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# ones.
3636
extensions = [
3737
"sphinx.ext.autodoc",
38+
"sphinx_autodoc_typehints",
3839
"sphinx.ext.intersphinx",
3940
"sphinx.ext.napoleon",
4041
"sphinx.ext.extlinks",
@@ -107,7 +108,7 @@
107108
#: Makes the sidebar "fixed" or pinned in place:
108109
"fixed_sidebar": True,
109110
#: Relative path to $PROJECT/_static to logo image:
110-
# "logo": "logo.svg",
111+
"logo": "logo.svg",
111112
#: Set to true to insert your site's project name under
112113
#: the logo:
113114
# "logo_name": True,
@@ -154,13 +155,14 @@
154155
#
155156
# -- Fonts
156157
# "code_font_size": "",
157-
"font_family": "",
158-
"head_font_family": "",
159-
"font_size": "1.25rem",
158+
"font_family": "'Roboto',sans-serif",
159+
"head_font_family": "'Roboto Slab',serif",
160+
"code_font_family": "'Roboto Mono',monospace",
161+
"font_size": "1.20rem",
160162
}
161163

162164
html_static_path = ["_static"]
163-
html_css_files = ["css/semver.css"]
165+
html_css_files = ["css/custom.css"]
164166

165167
# html_logo = "logo.svg"
166168

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Semver |version| -- Semantic Versioning
55
.. toctree::
66
:maxdepth: 2
77
:caption: Contents
8+
:numbered:
89

910
readme
1011
install

docs/install.rst

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Release Policy
55
--------------
66

77
As semver uses `Semantic Versioning`_, breaking changes are only introduced in major
8-
releases (incremented X in "X.Y.Z").
8+
releases (incremented ``X`` in "X.Y.Z").
99

1010
For users who want to stay with major 2 releases only, add the following version
1111
restriction::
1212

1313
semver>=2,<3
1414

1515
This line avoids surprises. You will get any updates within the major 2 release like
16-
2.9.1, 2.10.0, or above. However, you will never get an update for semver 3.0.0.
16+
2.11.0 or above. However, you will never get an update for semver 3.0.0.
1717

1818
Keep in mind, as this line avoids any major version updates, you also will never
1919
get new exciting features or bug fixes.
@@ -24,14 +24,6 @@ file that lists your dependencies.
2424
Pip
2525
---
2626

27-
For Python 2:
28-
29-
.. code-block:: bash
30-
31-
pip install semver
32-
33-
For Python 3:
34-
3527
.. code-block:: bash
3628
3729
pip3 install semver
@@ -41,7 +33,7 @@ with an URL and its version:
4133

4234
.. parsed-literal::
4335
44-
pip3 install git+https://github.com/python-semver/python-semver.git@2.10.0
36+
pip3 install git+https://github.com/python-semver/python-semver.git@2.11.0
4537
4638
4739
Linux Distributions

docs/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# requirements file for documentation
22
sphinx
33
sphinx-argparse
4-
# sphinx_rtd_theme
5-
guzzle_sphinx_theme
4+
sphinx-autodoc-typehints

0 commit comments

Comments
 (0)