Skip to main content

2009scape Sphinx theme

PyPI Python Sphinx Docs License Fonts

A Sphinx theme that dresses documentation as a 2009-era RuneScape interface. The design language is ported from runescapecn.

Live demo and full documentation →

Install

$ pip install sphinx-2009scape-theme
# docs/conf.py
html_theme = "2009scape"

html_theme_options = {
    "logo_text": "My Project",
    "github_url": "https://github.com/me/my-project",
}

That is the whole setup. The theme registers itself through a Sphinx entry point, so it does not need to be listed in extensions.

What you get

  • Layout: sticky header, global-toctree sidebar with client-side collapsing, "on this page" scrollspy column, breadcrumbs, prev/next panels, mobile drawer navigation.
  • Content: every docutils and Sphinx node styled: admonitions as interface panels with severity-coded edges, sunken code wells with copy buttons, bevelled tables, gold-edged API signatures, footnotes, glossaries, option lists, figures, search and index pages.
  • Fonts: ten RuneScape faces from the CC0-licensed RuneStar/fonts, bundled and served from the build output. No external requests at page load.
  • Highlighting: a Pygments style matching runescapecn's code colours (keywords green, attributes and numbers cyan, strings yellow).
  • Tokens: every colour, size and bevel is a CSS custom property, so the theme recolours from conf.py without forking a stylesheet.

The theme is dark by design, as the runescapecn registry is. A light palette can be layered on through css_variables.

Options

Full list with defaults in docs/configuration.rst. The ones most projects touch:

Option Default What it does
logo_text "" Text beside the logo in the header
logo_subtitle "" Small secondary line, e.g. a version tag
github_url / discord_url "" Header icon links
nav_links [] Header links: {"title": …, "doc": …} or {"title": …, "url": …}
announcement "" Gold banner above the header
source_repository "" Enables the "Edit this page" link
body_font rs rs, rs-quill, system, … or a raw CSS stack
base_font_size 20px Root font size
scanlines true Stone texture on panels
pixelated_images false image-rendering: pixelated on every image
css_variables {} Override any design token

Pixel fonts are not ideal for long-form reading, so chrome and body copy can be split and recolouring is a dict of tokens:

html_theme_options = {
    "body_font": "system",      # readable paragraphs
    "heading_font": "rs-bold",  # RuneScape headings and interface labels
    "css_variables": {
        "rs-gold": "#7fd4ff",
        "rs-content-max-width": "52rem",
    },
}

Code blocks always default to a real monospace face; pixel fonts and code indentation do not mix. The token list lives at the top of static/css/2009scape.css.

Development

$ git clone --recurse-submodules https://github.com/arsalan-anwari/2009scape-sphinx-theme
$ cd 2009scape-sphinx-theme
$ uv sync --extra docs --extra test    # .venv with the theme installed editable
$ uv run make -C docs html             # build the demo docs
$ uv run pytest                        # build-level tests

Releases go out through publish.sh, which runs the tests, uploads to PyPI and pushes the built docs to GitHub Pages:

$ ./publish.sh                # tests, PyPI, tag, gh-pages
$ ./publish.sh --docs-only    # just redeploy the docs
$ ./publish.sh --test-pypi    # dry run against TestPyPI

Licence

Theme code is Apache-2.0 (see LICENSE). The bundled RuneScape fonts come from RuneStar/fonts and are CC0-1.0.

Not affiliated with Jagex or RuneScape. A developer tribute, inspired by the game.

Metadata

Release files for sphinx-2009scape-theme 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinx-2009scape-theme 1.0.0
File Size Uploaded
sphinx_2009scape_theme-1.0.0.tar.gz 190.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinx-2009scape-theme 1.0.0
File Interpreter ABI Platform
sphinx_2009scape_theme-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 355.3 kB

Release files / sphinx_2009scape_theme-1.0.0.tar.gz

Download URL sphinx_2009scape_theme-1.0.0.tar.gz
Size 190.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a336c892c89aff63056a06c4bb6ec15732bca3d0012be74325af2fa4890bcebc
BLAKE2b-256 checksum
How to use checksums
75e648cae60bc303d28f41844c636a624865f01b23a35ad25d287af0ee5c3a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / sphinx_2009scape_theme-1.0.0-py3-none-any.whl

Download URL sphinx_2009scape_theme-1.0.0-py3-none-any.whl
Size 164.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e188b7ee4073c7bb52b0835f4f3414b805645134c7066df07ae6f7d4232e65e
BLAKE2b-256 checksum
How to use checksums
86c2b640cbb7648b55fd9453300e61ba3e5fdfc8a6117097e6a2d01d6979270d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page