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.1

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.1
File Size Uploaded
sphinx_2009scape_theme-1.0.1.tar.gz 190.6 kB Details

Built distribution (wheel)

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

Total release size: 355.4 kB

Release files / sphinx_2009scape_theme-1.0.1.tar.gz

Download URL sphinx_2009scape_theme-1.0.1.tar.gz
Size 190.6 kB
Tags Source
SHA-256 checksum
How to use checksums
55feb6cdfd141a1ab981c098abbe351951c4c0633850ea33f5eff8e880493b63
BLAKE2b-256 checksum
How to use checksums
3a05dad07a1d4aa9baabceab9285b742c05642ccd73b2884722111ffd2532e96
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.1-py3-none-any.whl

Download URL sphinx_2009scape_theme-1.0.1-py3-none-any.whl
Size 164.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac3046f48123e62ca280a8d72ba7216bd3f34523274d27102aaac7fe4176828b
BLAKE2b-256 checksum
How to use checksums
1950a83842c0dcfc9e99c1a8549bdc288a2a8c8e7c4519262f26de1df101bbde
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

This release

1.0.1 This release

2 release files

1.0.0

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