Metadata-Version: 2.4
Name: mohtat-sphinx-theme
Version: 0.1.0
Summary: A clean, responsive custom Sphinx theme with three-column navigation, light/dark/system modes, instant command-palette search, and configurable tab bar icons.
Home-page: https://github.com/SherullahMohtat/mohtat-sphinx-theme
Author: Sherullah Mohtat
License: MIT
Project-URL: Homepage, https://github.com/SherullahMohtat/mohtat-sphinx-theme
Project-URL: Repository, https://github.com/SherullahMohtat/mohtat-sphinx-theme
Project-URL: Documentation, https://github.com/SherullahMohtat/mohtat-sphinx-theme#readme
Project-URL: Issues, https://github.com/SherullahMohtat/mohtat-sphinx-theme/issues
Project-URL: Changelog, https://github.com/SherullahMohtat/mohtat-sphinx-theme/blob/main/CHANGELOG.md
Keywords: sphinx,sphinx-theme,documentation,responsive,dark-mode
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Sphinx
Classifier: Framework :: Sphinx :: Theme
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Documentation :: Sphinx
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sphinx>=6.0
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# 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

```bash
pip install mohtat-sphinx-theme
```

Or with `uv`:

```bash
uv pip install mohtat-sphinx-theme
```

### Option 2: Install Directly from GitHub

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

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

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

### Option 3: Install from Local Source (Development)

```bash
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

```bash
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`:

```python
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:

```bash
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

```bash
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

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

### 3. Upload to PyPI

**Manual upload via Twine:**

```bash
# 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:

```bash
git tag v0.1.0
git push origin v0.1.0
```

## License

MIT License — see [LICENSE](LICENSE).
