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

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.2
File Size Uploaded
sphinx_2009scape_theme-1.0.2.tar.gz 190.0 kB Details

Built distribution (wheel)

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

Total release size: 355.0 kB

Release files / sphinx_2009scape_theme-1.0.2.tar.gz

Download URL sphinx_2009scape_theme-1.0.2.tar.gz
Size 190.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7f732edf83a8a65e4fddeb9c32fa741ae2054782d9a0da18205c2817d604e4ae
BLAKE2b-256 checksum
How to use checksums
83cb9b28be31f82fbc87245e7890778dd40b69611a13c7baec48f705d398df81
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.2-py3-none-any.whl

Download URL sphinx_2009scape_theme-1.0.2-py3-none-any.whl
Size 165.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86dc1caa8e9fbbcba214c025aa0e4853b7f533ee841f75a787dca60ae2572834
BLAKE2b-256 checksum
How to use checksums
641dc85c4cd459509e011d7268ee3ab91a02e1d97325ac517cafc64cac48750a
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

This release

1.0.2 This release

2 release files

1.0.1

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