| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff 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 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,3 +13,12 @@ | |||
| 13 | 13 | - bump version (YYYY.MM.dev) in setup.py and python_docs_theme/theme.conf | |
| 14 | 14 | - Commit this last bump. | |
| 15 | 15 | - 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``. | ||
| Original file line number | Diff line number | Diff 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'))" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,48 @@ | |||
| 1 | 1 | [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", | ||
| 5 | 33 | ] | |
| 6 | - build-backend = "setuptools.build_meta" | ||
| 7 | 34 | ||
| 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 | + ] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -186,7 +186,7 @@ div.body a:hover { | |||
| 186 | 186 | } | |
| 187 | 187 | ||
| 188 | 188 | tt, code, pre { | |
| 189 | - font-family: "monospace", monospace; | ||
| 189 | + font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace; | ||
| 190 | 190 | font-size: 96.5%; | |
| 191 | 191 | } | |
| 192 | 192 | ||
@@ -238,7 +238,6 @@ table.footnote td { | |||
| 238 | 238 | ||
| 239 | 239 | div.footer { | |
| 240 | 240 | line-height: 150%; | |
| 241 | - margin-top: -2em; | ||
| 242 | 241 | text-align: right; | |
| 243 | 242 | width: auto; | |
| 244 | 243 | margin-right: 10px; | |
@@ -257,7 +256,7 @@ div.footer a:hover { | |||
| 257 | 256 | } | |
| 258 | 257 | ||
| 259 | 258 | 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; | ||
| 261 | 260 | } | |
| 262 | 261 | ||
| 263 | 262 | .toctree-wrapper ul { | |
@@ -268,6 +267,18 @@ dl > dt span ~ em { | |||
| 268 | 267 | margin-left: .5em; | |
| 269 | 268 | } | |
| 270 | 269 | ||
| 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 | + | ||
| 271 | 282 | @media (max-width: 1023px) { | |
| 272 | 283 | /* Body layout */ | |
| 273 | 284 | div.body { | |
@@ -304,6 +315,9 @@ dl > dt span ~ em { | |||
| 304 | 315 | html { | |
| 305 | 316 | scroll-padding-top: 40px; | |
| 306 | 317 | } | |
| 318 | + body { | ||
| 319 | + margin-top: 40px; | ||
| 320 | + } | ||
| 307 | 321 | ||
| 308 | 322 | /* Top navigation bar */ | |
| 309 | 323 | .mobile-nav { | |
@@ -487,7 +501,6 @@ dl > dt span ~ em { | |||
| 487 | 501 | width: 100%; | |
| 488 | 502 | } | |
| 489 | 503 | .document { | |
| 490 | - padding-top: 40px; | ||
| 491 | 504 | position: relative; | |
| 492 | 505 | z-index: 0; | |
| 493 | 506 | } | |
@@ -507,3 +520,9 @@ dl > dt span ~ em { | |||
| 507 | 520 | flex: auto; | |
| 508 | 521 | } | |
| 509 | 522 | } | |
| 523 | + | ||
| 524 | + @media (min-width: 1024px) { | ||
| 525 | + div.footer { | ||
| 526 | + margin-top: -2em; | ||
| 527 | + } | ||
| 528 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments