Skip to content

Commit 84f34ae

Browse files
committed
Merge branch 'master' into dark-theme
2 parents eb5e3cb + b84c913 commit 84f34ae

File tree

8 files changed

+121
-50
lines changed

8 files changed

+121
-50
lines changed

.readthedocs.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
# Project page: https://readthedocs.org/projects/python-docs-theme-previews/
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3"
11+
12+
commands:
13+
- git clone --depth=1 https://github.com/python/cpython
14+
- make html CPYTHON_PATH=cpython
15+
- mv cpython/Doc/build _readthedocs

CONTRIBUTING.rst

+9
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,12 @@
1313
- bump version (YYYY.MM.dev) in setup.py and python_docs_theme/theme.conf
1414
- Commit this last bump.
1515
- push and push the tag (``git push && git push --tags``)
16+
17+
# Makefile usage
18+
19+
This project includes a simple Makefile for syncing changes to the theme with
20+
the main CPython repository. Run ``make help`` for details on available rules.
21+
22+
There is one configurable variable, ``CPYTHON_PATH``, which should be the path
23+
to the CPython repository on your machine. By default, it points to
24+
``../cpython``.

MANIFEST.in

-2
This file was deleted.

Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# You can set these variables from the command line.
2+
CPYTHON_PATH = ../cpython
3+
PYTHON = python3
4+
PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz)
5+
6+
7+
.PHONY: help
8+
help:
9+
@echo "Please use \`make <target>' where <target> is one of"
10+
@echo " venv to create a venv with necessary tools at $(CPYTHON_PATH)/Doc/venv"
11+
@echo " html to make standalone CPython HTML files"
12+
@echo " htmlview to open the index page built by the html target in your browser"
13+
14+
.PHONY: venv
15+
venv:
16+
$(PYTHON) -m pip install build
17+
$(PYTHON) -m build
18+
cd $(CPYTHON_PATH)/Doc \
19+
&& make venv \
20+
&& ./venv/bin/pip install $(PACKAGE_ABS_PATH)
21+
22+
.PHONY: html
23+
html: venv
24+
cd $(CPYTHON_PATH)/Doc && \
25+
make html
26+
27+
.PHONY: htmlview
28+
htmlview: html
29+
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(CPYTHON_PATH)/Doc/build/html/index.html'))"

pyproject.toml

+45-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,48 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
2+
requires = ["flit_core>=3.7"]
3+
build-backend = "flit_core.buildapi"
4+
5+
# project metadata
6+
[project]
7+
name = "python-docs-theme"
8+
version = "2022.1"
9+
description = "The Sphinx theme for the CPython docs and related projects"
10+
readme = "README.rst"
11+
urls.Code = "https://github.com/python/python-docs-theme"
12+
urls.Download = "https://pypi.org/project/python-docs-theme/"
13+
urls.Homepage = "https://github.com/python/python-docs-theme/"
14+
urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues"
15+
license.text = "PSF-2.0"
16+
requires-python = ">=3.8"
17+
18+
# Classifiers list: https://pypi.org/classifiers/
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Framework :: Sphinx :: Theme",
22+
"Intended Audience :: Developers",
23+
"License :: OSI Approved :: Python Software Foundation License",
24+
"Operating System :: OS Independent",
25+
"Topic :: Documentation",
26+
"Topic :: Software Development :: Documentation",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
533
]
6-
build-backend = "setuptools.build_meta"
734

35+
[[project.authors]]
36+
name = "PyPA"
37+
email = "distutils-sig@python.org"
38+
39+
[project.entry-points."sphinx.html_themes"]
40+
python_docs_theme = 'python_docs_theme'
41+
42+
[tool.flit.module]
43+
name = "python_docs_theme"
44+
45+
[tool.flit.sdist]
46+
include = [
47+
"python_docs_theme/",
48+
]

python_docs_theme/static/pydoctheme.css

+23-4
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ div.body a:hover {
186186
}
187187

188188
tt, code, pre {
189-
font-family: "monospace", monospace;
189+
font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace;
190190
font-size: 96.5%;
191191
}
192192

@@ -238,7 +238,6 @@ table.footnote td {
238238

239239
div.footer {
240240
line-height: 150%;
241-
margin-top: -2em;
242241
text-align: right;
243242
width: auto;
244243
margin-right: 10px;
@@ -257,7 +256,7 @@ div.footer a:hover {
257256
}
258257

259258
dl > dt span ~ em {
260-
font-family: "monospace", monospace;
259+
font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace;
261260
}
262261

263262
.toctree-wrapper ul {
@@ -268,6 +267,18 @@ dl > dt span ~ em {
268267
margin-left: .5em;
269268
}
270269

270+
div.genindex-jumpbox,
271+
div.genindex-jumpbox > p {
272+
display: inline-flex;
273+
flex-wrap: wrap;
274+
}
275+
276+
div.genindex-jumpbox a {
277+
margin: 0 5px;
278+
min-width: 30px;
279+
text-align: center;
280+
}
281+
271282
@media (max-width: 1023px) {
272283
/* Body layout */
273284
div.body {
@@ -304,6 +315,9 @@ dl > dt span ~ em {
304315
html {
305316
scroll-padding-top: 40px;
306317
}
318+
body {
319+
margin-top: 40px;
320+
}
307321

308322
/* Top navigation bar */
309323
.mobile-nav {
@@ -487,7 +501,6 @@ dl > dt span ~ em {
487501
width: 100%;
488502
}
489503
.document {
490-
padding-top: 40px;
491504
position: relative;
492505
z-index: 0;
493506
}
@@ -507,3 +520,9 @@ dl > dt span ~ em {
507520
flex: auto;
508521
}
509522
}
523+
524+
@media (min-width: 1024px) {
525+
div.footer {
526+
margin-top: -2em;
527+
}
528+
}

setup.cfg

-2
This file was deleted.

setup.py

-38
This file was deleted.

0 commit comments

Comments
 (0)