Skip to main content

mohtat-sphinx-theme

A responsive, zero-dependency custom Sphinx HTML theme built from scratch with modular Jinja2 templates, CSS custom property design tokens, and progressive vanilla JavaScript.

Features

  • Three-Column Desktop Layout: Collapsible left hierarchical navigation tree, readable main content column, and sticky right Contents sidebar with live ScrollSpy highlighting.
  • Responsive Mobile & Tablet Drawers: Viewports <= 1100px automatically convert both sidebars into off-canvas slide-over drawers with a dimmed backdrop and dedicated toolbar triggers.
  • Light, Dark, and System (auto) Modes: Zero-flash initialization script in <head> with a three-state toolbar toggle persisted in localStorage.
  • Command-Palette Search Modal: Press Cmd+K (macOS) or Ctrl+K (Windows/Linux) or click any search trigger to search searchindex.js instantaneously over both http(s):// and file://.
  • Tab Bar & Icon Integration (sherullah.png): Bundled sherullah.png wired into the browser tab favicon, configurable top header tab_bar_items, and interactive .. tab-bar:: / .. tab-item:: directives.

Installation Guide

Requirements

  • Python: 3.9 or newer
  • Sphinx: 6.0 or newer

Option 1: Install from PyPI

pip install mohtat-sphinx-theme

Or with uv:

uv pip install mohtat-sphinx-theme

Option 2: Install Directly from GitHub

pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git

To pin a specific release tag (for example v0.1.0):

pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git@v0.1.0

Option 3: Install from Local Source (Development)

git clone https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
cd mohtat-sphinx-theme
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Verify Installation

python3 -c "import mohtat_sphinx_theme; print(mohtat_sphinx_theme.get_html_theme_path())"

Quick Start (conf.py)

Add mohtat-sphinx-theme to your Sphinx project's docs/source/conf.py:

project = "My Documentation"
author = "Sherullah Mohtat"
copyright = "2026 Sherullah Mohtat"

# Optional unless you use .. tab-bar:: / .. tab-item:: directives
extensions = ["mohtat_sphinx_theme"]

html_theme = "mohtat-sphinx-theme"

html_theme_options = {
    "sidebar_caption": "MY PROJECT",
    "show_topbar": True,
    "topbar_title": "My Documentation",
    "show_tab_bar": True,
    "tab_bar_icon": "sherullah.png",
    "tab_bar_items": [
        {"title": "Overview", "url": "index", "icon": "sherullah.png"},
        {"title": "Guide", "url": "guide/index", "icon": "sherullah.png"},
    ],
    "default_theme_mode": "auto",
    "show_prev_next": True,
    "show_toc": True,
    "toc_title": "Contents",
    "show_search": True,
}

Build your HTML documentation:

sphinx-build -b html docs/source docs/_build/html

Key Theme Options

Option Default Description
sidebar_caption "" Uppercase heading above the left navigation tree
show_topbar true Shows or hides the top dark header bar
topbar_title "" Brand text on the left side of the top bar
show_tab_bar true Shows or hides the top header tab bar
tab_bar_icon "sherullah.png" Static icon filename in _static/ for favicons and tabs
tab_bar_items "" List of {"title", "url", "icon"} dicts for top tabs
default_theme_mode "auto" Initial mode: "auto", "light", or "dark"
show_fullscreen_button true Displays fullscreen/wide toggle in the toolbar
show_theme_toggle true Displays light/dark/system mode toggle in the toolbar
show_prev_next true Renders Previous/Next cards below page content
show_toc true Renders right-hand Contents sidebar on pages with headings
toc_title "Contents" Heading text for the right-hand TOC
show_search true Enables sidebar search pill, mobile icon, and Cmd/Ctrl+K modal
accent_color "" Optional CSS color override for --mht-accent
content_max_width "860px" Maximum reading column width on desktop
footer_author "" Author label shown in the footer

Publishing to GitHub & PyPI

1. Push to GitHub

git init
git add .
git commit -m "Initial release of mohtat-sphinx-theme v0.1.0"
git branch -M main
git remote add origin https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
git push -u origin main

2. Build & Validate Distributions Locally

python -m pip install build twine
python -m build
twine check dist/*

3. Upload to PyPI

Manual upload via Twine:

# Optional: verify on TestPyPI first
twine upload --repository testpypi dist/*

# Upload to production PyPI
twine upload dist/*

Automated upload via GitHub Actions: This repository includes .github/workflows/publish-pypi.yml configured for PyPI Trusted Publishing. Configure a Trusted Publisher on pypi.org pointing to your GitHub repository (environment: pypi), then push a version tag:

git tag v0.1.0
git push origin v0.1.0

License

MIT License — see LICENSE.

Metadata

Release files for mohtat-sphinx-theme 0.1.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 mohtat-sphinx-theme 0.1.0
File Size Uploaded Provenance Actions
mohtat_sphinx_theme-0.1.0.tar.gz 427.3 kB Without provenance Details for mohtat_sphinx_theme-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mohtat-sphinx-theme 0.1.0
File Interpreter ABI Platform Actions
mohtat_sphinx_theme-0.1.0-py3-none-any.whl Python 3 none any Details for mohtat_sphinx_theme-0.1.0-py3-none-any.whl

Total release size: 844.6 kB

Release files / mohtat_sphinx_theme-0.1.0.tar.gz

Download URL mohtat_sphinx_theme-0.1.0.tar.gz
Size 427.3 kB
Tags Source
SHA-256 checksum
How to use checksums
63a36724ca428790198ddedf1ce65079c26fe73ecc94b02989e2f527a87721a7
BLAKE2b-256 checksum
How to use checksums
c0e53b12387541b5b2bedf4ff2d2818987808e59b3eb06ca10dbbf6fae43f719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / mohtat_sphinx_theme-0.1.0-py3-none-any.whl

Download URL mohtat_sphinx_theme-0.1.0-py3-none-any.whl
Size 417.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a875db2fc9a408ed6ee9cb8cf8461d6ea6676e63b6c27b0fa3a70cc9957aa870
BLAKE2b-256 checksum
How to use checksums
873ccb8eeacf011c992568d774156327da52dc16efca777579480362fbb66b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for mohtat-sphinx-theme 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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