mohtat-sphinx-theme 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mohtat_sphinx_theme-0.1.0/CHANGELOG.md +13 -0
- mohtat_sphinx_theme-0.1.0/LICENSE +21 -0
- mohtat_sphinx_theme-0.1.0/MANIFEST.in +15 -0
- mohtat_sphinx_theme-0.1.0/PKG-INFO +208 -0
- mohtat_sphinx_theme-0.1.0/README.md +170 -0
- mohtat_sphinx_theme-0.1.0/docs/Makefile +17 -0
- mohtat_sphinx_theme-0.1.0/docs/source/conf.py +48 -0
- mohtat_sphinx_theme-0.1.0/docs/source/configuration/index.rst +11 -0
- mohtat_sphinx_theme-0.1.0/docs/source/configuration/navigation-and-search.rst +28 -0
- mohtat_sphinx_theme-0.1.0/docs/source/configuration/tab-bar-and-icons.rst +69 -0
- mohtat_sphinx_theme-0.1.0/docs/source/configuration/theme-options.rst +98 -0
- mohtat_sphinx_theme-0.1.0/docs/source/getting-started/index.rst +11 -0
- mohtat_sphinx_theme-0.1.0/docs/source/getting-started/installation.rst +99 -0
- mohtat_sphinx_theme-0.1.0/docs/source/getting-started/publishing.rst +89 -0
- mohtat_sphinx_theme-0.1.0/docs/source/getting-started/quickstart.rst +47 -0
- mohtat_sphinx_theme-0.1.0/docs/source/index.rst +51 -0
- mohtat_sphinx_theme-0.1.0/docs/source/layout-and-design/content-components.rst +55 -0
- mohtat_sphinx_theme-0.1.0/docs/source/layout-and-design/index.rst +11 -0
- mohtat_sphinx_theme-0.1.0/docs/source/layout-and-design/light-dark-modes.rst +25 -0
- mohtat_sphinx_theme-0.1.0/docs/source/layout-and-design/responsive-breakpoints.rst +47 -0
- mohtat_sphinx_theme-0.1.0/docs/source/reference/css-tokens.rst +67 -0
- mohtat_sphinx_theme-0.1.0/docs/source/reference/index.rst +10 -0
- mohtat_sphinx_theme-0.1.0/docs/source/reference/template-blocks.rst +54 -0
- mohtat_sphinx_theme-0.1.0/pyproject.toml +70 -0
- mohtat_sphinx_theme-0.1.0/setup.cfg +4 -0
- mohtat_sphinx_theme-0.1.0/setup.py +55 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/__init__.py +190 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/domainindex.html +37 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/genindex.html +51 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/layout.html +134 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/page.html +5 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/footer.html +14 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/left_sidebar.html +53 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/prev_next.html +29 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/right_sidebar.html +27 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/search_modal.html +28 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/tabbar.html +28 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/toolbar.html +84 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/partials/topbar.html +10 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/search.html +25 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/components.css +755 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/content.css +364 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/layout.css +340 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/pygments.css +45 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/theme.css +5 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/css/tokens.css +142 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/js/theme.js +852 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/static/sherullah.png +0 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme/theme.conf +24 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/PKG-INFO +208 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/SOURCES.txt +54 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/dependency_links.txt +1 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/entry_points.txt +3 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/requires.txt +5 -0
- mohtat_sphinx_theme-0.1.0/src/mohtat_sphinx_theme.egg-info/top_level.txt +1 -0
- mohtat_sphinx_theme-0.1.0/tests/test_theme.py +117 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `mohtat-sphinx-theme` are documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-12-03
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Custom Sphinx theme built from scratch (`inherit = none`) with modular Jinja2 templates and CSS custom property tokens.
|
|
9
|
+
- Responsive three-column desktop shell (collapsible left navigation tree, centered reading canvas, sticky right `Contents` ScrollSpy sidebar) and off-canvas slide-over drawers on viewports `<= 1100px`.
|
|
10
|
+
- Zero-flash Light, Dark, and System (`auto`) color modes with `localStorage` persistence.
|
|
11
|
+
- Command-palette search modal (`Cmd+K` / `Ctrl+K`) and standalone `search.html` powered by Sphinx's `searchindex.js` (compatible with both `http(s)://` and `file://`).
|
|
12
|
+
- Bundled `sherullah.png` asset wired into the browser tab favicon, top header tab bar (`tab_bar_items`), and custom `.. tab-bar::` / `.. tab-item::` directives.
|
|
13
|
+
- Package metadata (`pyproject.toml`, `setup.py`, `MANIFEST.in`), unit test suite (`tests/test_theme.py`), and full documentation under `docs/source/`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sherullah Mohtat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
include pyproject.toml
|
|
5
|
+
include setup.py
|
|
6
|
+
|
|
7
|
+
recursive-include src/mohtat_sphinx_theme *.conf *.html *.css *.js *.png
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
recursive-include docs/source *.rst *.py
|
|
10
|
+
include docs/Makefile
|
|
11
|
+
|
|
12
|
+
prune .agent
|
|
13
|
+
prune .venv
|
|
14
|
+
prune docs/_build
|
|
15
|
+
global-exclude __pycache__ *.py[cod] .DS_Store
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mohtat-sphinx-theme
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A clean, responsive custom Sphinx theme with three-column navigation, light/dark/system modes, instant command-palette search, and configurable tab bar icons.
|
|
5
|
+
Home-page: https://github.com/SherullahMohtat/mohtat-sphinx-theme
|
|
6
|
+
Author: Sherullah Mohtat
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/SherullahMohtat/mohtat-sphinx-theme
|
|
9
|
+
Project-URL: Repository, https://github.com/SherullahMohtat/mohtat-sphinx-theme
|
|
10
|
+
Project-URL: Documentation, https://github.com/SherullahMohtat/mohtat-sphinx-theme#readme
|
|
11
|
+
Project-URL: Issues, https://github.com/SherullahMohtat/mohtat-sphinx-theme/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/SherullahMohtat/mohtat-sphinx-theme/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: sphinx,sphinx-theme,documentation,responsive,dark-mode
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Framework :: Sphinx
|
|
16
|
+
Classifier: Framework :: Sphinx :: Theme
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Topic :: Documentation
|
|
27
|
+
Classifier: Topic :: Documentation :: Sphinx
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: sphinx>=6.0
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
34
|
+
Requires-Dist: twine>=5.0; extra == "dev"
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
|
|
39
|
+
# mohtat-sphinx-theme
|
|
40
|
+
|
|
41
|
+
A responsive, zero-dependency custom Sphinx HTML theme built from scratch with modular Jinja2 templates, CSS custom property design tokens, and progressive vanilla JavaScript.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- **Three-Column Desktop Layout**: Collapsible left hierarchical navigation tree, readable main content column, and sticky right `Contents` sidebar with live ScrollSpy highlighting.
|
|
46
|
+
- **Responsive Mobile & Tablet Drawers**: Viewports `<= 1100px` automatically convert both sidebars into off-canvas slide-over drawers with a dimmed backdrop and dedicated toolbar triggers.
|
|
47
|
+
- **Light, Dark, and System (`auto`) Modes**: Zero-flash initialization script in `<head>` with a three-state toolbar toggle persisted in `localStorage`.
|
|
48
|
+
- **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://`.
|
|
49
|
+
- **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.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation Guide
|
|
54
|
+
|
|
55
|
+
### Requirements
|
|
56
|
+
|
|
57
|
+
- **Python**: `3.9` or newer
|
|
58
|
+
- **Sphinx**: `6.0` or newer
|
|
59
|
+
|
|
60
|
+
### Option 1: Install from PyPI
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install mohtat-sphinx-theme
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or with `uv`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uv pip install mohtat-sphinx-theme
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Option 2: Install Directly from GitHub
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
To pin a specific release tag (for example `v0.1.0`):
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git@v0.1.0
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Option 3: Install from Local Source (Development)
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git clone https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
88
|
+
cd mohtat-sphinx-theme
|
|
89
|
+
python3 -m venv .venv
|
|
90
|
+
source .venv/bin/activate
|
|
91
|
+
pip install -e ".[dev]"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Verify Installation
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
python3 -c "import mohtat_sphinx_theme; print(mohtat_sphinx_theme.get_html_theme_path())"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Quick Start (`conf.py`)
|
|
103
|
+
|
|
104
|
+
Add `mohtat-sphinx-theme` to your Sphinx project's `docs/source/conf.py`:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
project = "My Documentation"
|
|
108
|
+
author = "Sherullah Mohtat"
|
|
109
|
+
copyright = "2026 Sherullah Mohtat"
|
|
110
|
+
|
|
111
|
+
# Optional unless you use .. tab-bar:: / .. tab-item:: directives
|
|
112
|
+
extensions = ["mohtat_sphinx_theme"]
|
|
113
|
+
|
|
114
|
+
html_theme = "mohtat-sphinx-theme"
|
|
115
|
+
|
|
116
|
+
html_theme_options = {
|
|
117
|
+
"sidebar_caption": "MY PROJECT",
|
|
118
|
+
"show_topbar": True,
|
|
119
|
+
"topbar_title": "My Documentation",
|
|
120
|
+
"show_tab_bar": True,
|
|
121
|
+
"tab_bar_icon": "sherullah.png",
|
|
122
|
+
"tab_bar_items": [
|
|
123
|
+
{"title": "Overview", "url": "index", "icon": "sherullah.png"},
|
|
124
|
+
{"title": "Guide", "url": "guide/index", "icon": "sherullah.png"},
|
|
125
|
+
],
|
|
126
|
+
"default_theme_mode": "auto",
|
|
127
|
+
"show_prev_next": True,
|
|
128
|
+
"show_toc": True,
|
|
129
|
+
"toc_title": "Contents",
|
|
130
|
+
"show_search": True,
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Build your HTML documentation:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
sphinx-build -b html docs/source docs/_build/html
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Key Theme Options
|
|
143
|
+
|
|
144
|
+
| Option | Default | Description |
|
|
145
|
+
| --- | --- | --- |
|
|
146
|
+
| `sidebar_caption` | `""` | Uppercase heading above the left navigation tree |
|
|
147
|
+
| `show_topbar` | `true` | Shows or hides the top dark header bar |
|
|
148
|
+
| `topbar_title` | `""` | Brand text on the left side of the top bar |
|
|
149
|
+
| `show_tab_bar` | `true` | Shows or hides the top header tab bar |
|
|
150
|
+
| `tab_bar_icon` | `"sherullah.png"` | Static icon filename in `_static/` for favicons and tabs |
|
|
151
|
+
| `tab_bar_items` | `""` | List of `{"title", "url", "icon"}` dicts for top tabs |
|
|
152
|
+
| `default_theme_mode` | `"auto"` | Initial mode: `"auto"`, `"light"`, or `"dark"` |
|
|
153
|
+
| `show_fullscreen_button` | `true` | Displays fullscreen/wide toggle in the toolbar |
|
|
154
|
+
| `show_theme_toggle` | `true` | Displays light/dark/system mode toggle in the toolbar |
|
|
155
|
+
| `show_prev_next` | `true` | Renders Previous/Next cards below page content |
|
|
156
|
+
| `show_toc` | `true` | Renders right-hand `Contents` sidebar on pages with headings |
|
|
157
|
+
| `toc_title` | `"Contents"` | Heading text for the right-hand TOC |
|
|
158
|
+
| `show_search` | `true` | Enables sidebar search pill, mobile icon, and `Cmd/Ctrl+K` modal |
|
|
159
|
+
| `accent_color` | `""` | Optional CSS color override for `--mht-accent` |
|
|
160
|
+
| `content_max_width` | `"860px"` | Maximum reading column width on desktop |
|
|
161
|
+
| `footer_author` | `""` | Author label shown in the footer |
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Publishing to GitHub & PyPI
|
|
166
|
+
|
|
167
|
+
### 1. Push to GitHub
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
git init
|
|
171
|
+
git add .
|
|
172
|
+
git commit -m "Initial release of mohtat-sphinx-theme v0.1.0"
|
|
173
|
+
git branch -M main
|
|
174
|
+
git remote add origin https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
175
|
+
git push -u origin main
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 2. Build & Validate Distributions Locally
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
python -m pip install build twine
|
|
182
|
+
python -m build
|
|
183
|
+
twine check dist/*
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 3. Upload to PyPI
|
|
187
|
+
|
|
188
|
+
**Manual upload via Twine:**
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Optional: verify on TestPyPI first
|
|
192
|
+
twine upload --repository testpypi dist/*
|
|
193
|
+
|
|
194
|
+
# Upload to production PyPI
|
|
195
|
+
twine upload dist/*
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Automated upload via GitHub Actions:**
|
|
199
|
+
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:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
git tag v0.1.0
|
|
203
|
+
git push origin v0.1.0
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
|
|
208
|
+
MIT License — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# mohtat-sphinx-theme
|
|
2
|
+
|
|
3
|
+
A responsive, zero-dependency custom Sphinx HTML theme built from scratch with modular Jinja2 templates, CSS custom property design tokens, and progressive vanilla JavaScript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Three-Column Desktop Layout**: Collapsible left hierarchical navigation tree, readable main content column, and sticky right `Contents` sidebar with live ScrollSpy highlighting.
|
|
8
|
+
- **Responsive Mobile & Tablet Drawers**: Viewports `<= 1100px` automatically convert both sidebars into off-canvas slide-over drawers with a dimmed backdrop and dedicated toolbar triggers.
|
|
9
|
+
- **Light, Dark, and System (`auto`) Modes**: Zero-flash initialization script in `<head>` with a three-state toolbar toggle persisted in `localStorage`.
|
|
10
|
+
- **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://`.
|
|
11
|
+
- **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.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Installation Guide
|
|
16
|
+
|
|
17
|
+
### Requirements
|
|
18
|
+
|
|
19
|
+
- **Python**: `3.9` or newer
|
|
20
|
+
- **Sphinx**: `6.0` or newer
|
|
21
|
+
|
|
22
|
+
### Option 1: Install from PyPI
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install mohtat-sphinx-theme
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or with `uv`:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv pip install mohtat-sphinx-theme
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Option 2: Install Directly from GitHub
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
To pin a specific release tag (for example `v0.1.0`):
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install git+https://github.com/SherullahMohtat/mohtat-sphinx-theme.git@v0.1.0
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Option 3: Install from Local Source (Development)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
50
|
+
cd mohtat-sphinx-theme
|
|
51
|
+
python3 -m venv .venv
|
|
52
|
+
source .venv/bin/activate
|
|
53
|
+
pip install -e ".[dev]"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Verify Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python3 -c "import mohtat_sphinx_theme; print(mohtat_sphinx_theme.get_html_theme_path())"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Quick Start (`conf.py`)
|
|
65
|
+
|
|
66
|
+
Add `mohtat-sphinx-theme` to your Sphinx project's `docs/source/conf.py`:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
project = "My Documentation"
|
|
70
|
+
author = "Sherullah Mohtat"
|
|
71
|
+
copyright = "2026 Sherullah Mohtat"
|
|
72
|
+
|
|
73
|
+
# Optional unless you use .. tab-bar:: / .. tab-item:: directives
|
|
74
|
+
extensions = ["mohtat_sphinx_theme"]
|
|
75
|
+
|
|
76
|
+
html_theme = "mohtat-sphinx-theme"
|
|
77
|
+
|
|
78
|
+
html_theme_options = {
|
|
79
|
+
"sidebar_caption": "MY PROJECT",
|
|
80
|
+
"show_topbar": True,
|
|
81
|
+
"topbar_title": "My Documentation",
|
|
82
|
+
"show_tab_bar": True,
|
|
83
|
+
"tab_bar_icon": "sherullah.png",
|
|
84
|
+
"tab_bar_items": [
|
|
85
|
+
{"title": "Overview", "url": "index", "icon": "sherullah.png"},
|
|
86
|
+
{"title": "Guide", "url": "guide/index", "icon": "sherullah.png"},
|
|
87
|
+
],
|
|
88
|
+
"default_theme_mode": "auto",
|
|
89
|
+
"show_prev_next": True,
|
|
90
|
+
"show_toc": True,
|
|
91
|
+
"toc_title": "Contents",
|
|
92
|
+
"show_search": True,
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Build your HTML documentation:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
sphinx-build -b html docs/source docs/_build/html
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Key Theme Options
|
|
105
|
+
|
|
106
|
+
| Option | Default | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `sidebar_caption` | `""` | Uppercase heading above the left navigation tree |
|
|
109
|
+
| `show_topbar` | `true` | Shows or hides the top dark header bar |
|
|
110
|
+
| `topbar_title` | `""` | Brand text on the left side of the top bar |
|
|
111
|
+
| `show_tab_bar` | `true` | Shows or hides the top header tab bar |
|
|
112
|
+
| `tab_bar_icon` | `"sherullah.png"` | Static icon filename in `_static/` for favicons and tabs |
|
|
113
|
+
| `tab_bar_items` | `""` | List of `{"title", "url", "icon"}` dicts for top tabs |
|
|
114
|
+
| `default_theme_mode` | `"auto"` | Initial mode: `"auto"`, `"light"`, or `"dark"` |
|
|
115
|
+
| `show_fullscreen_button` | `true` | Displays fullscreen/wide toggle in the toolbar |
|
|
116
|
+
| `show_theme_toggle` | `true` | Displays light/dark/system mode toggle in the toolbar |
|
|
117
|
+
| `show_prev_next` | `true` | Renders Previous/Next cards below page content |
|
|
118
|
+
| `show_toc` | `true` | Renders right-hand `Contents` sidebar on pages with headings |
|
|
119
|
+
| `toc_title` | `"Contents"` | Heading text for the right-hand TOC |
|
|
120
|
+
| `show_search` | `true` | Enables sidebar search pill, mobile icon, and `Cmd/Ctrl+K` modal |
|
|
121
|
+
| `accent_color` | `""` | Optional CSS color override for `--mht-accent` |
|
|
122
|
+
| `content_max_width` | `"860px"` | Maximum reading column width on desktop |
|
|
123
|
+
| `footer_author` | `""` | Author label shown in the footer |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Publishing to GitHub & PyPI
|
|
128
|
+
|
|
129
|
+
### 1. Push to GitHub
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
git init
|
|
133
|
+
git add .
|
|
134
|
+
git commit -m "Initial release of mohtat-sphinx-theme v0.1.0"
|
|
135
|
+
git branch -M main
|
|
136
|
+
git remote add origin https://github.com/SherullahMohtat/mohtat-sphinx-theme.git
|
|
137
|
+
git push -u origin main
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 2. Build & Validate Distributions Locally
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
python -m pip install build twine
|
|
144
|
+
python -m build
|
|
145
|
+
twine check dist/*
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 3. Upload to PyPI
|
|
149
|
+
|
|
150
|
+
**Manual upload via Twine:**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Optional: verify on TestPyPI first
|
|
154
|
+
twine upload --repository testpypi dist/*
|
|
155
|
+
|
|
156
|
+
# Upload to production PyPI
|
|
157
|
+
twine upload dist/*
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Automated upload via GitHub Actions:**
|
|
161
|
+
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:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
git tag v0.1.0
|
|
165
|
+
git push origin v0.1.0
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## License
|
|
169
|
+
|
|
170
|
+
MIT License — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Minimal Makefile for mohtat-sphinx-theme documentation
|
|
2
|
+
|
|
3
|
+
SPHINXOPTS ?=
|
|
4
|
+
SPHINXBUILD ?= /usr/bin/python3 -m sphinx
|
|
5
|
+
SOURCEDIR = source
|
|
6
|
+
BUILDDIR = _build
|
|
7
|
+
|
|
8
|
+
.PHONY: help html clean
|
|
9
|
+
|
|
10
|
+
help:
|
|
11
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
12
|
+
|
|
13
|
+
html:
|
|
14
|
+
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
|
|
15
|
+
|
|
16
|
+
clean:
|
|
17
|
+
rm -rf "$(BUILDDIR)"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Sphinx configuration for the mohtat-sphinx-theme documentation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
sys.path.insert(0, os.path.abspath("../../src"))
|
|
9
|
+
|
|
10
|
+
project = "mohtat-sphinx-theme"
|
|
11
|
+
author = "Sherullah Mohtat"
|
|
12
|
+
copyright = "2026 Sherullah Mohtat"
|
|
13
|
+
release = "0.1.0"
|
|
14
|
+
|
|
15
|
+
extensions = [
|
|
16
|
+
"mohtat_sphinx_theme",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
html_theme = "mohtat-sphinx-theme"
|
|
20
|
+
html_title = "mohtat-sphinx-theme"
|
|
21
|
+
|
|
22
|
+
html_theme_options = {
|
|
23
|
+
"sidebar_caption": "MOHTAT SPHINX THEME",
|
|
24
|
+
"show_topbar": True,
|
|
25
|
+
"topbar_title": "mohtat-sphinx-theme",
|
|
26
|
+
"show_tab_bar": True,
|
|
27
|
+
"tab_bar_icon": "sherullah.png",
|
|
28
|
+
"tab_bar_items": [
|
|
29
|
+
{"title": "Overview", "url": "index", "icon": "sherullah.png"},
|
|
30
|
+
{"title": "Getting Started", "url": "getting-started/index", "icon": "sherullah.png"},
|
|
31
|
+
{"title": "Configuration", "url": "configuration/index", "icon": "sherullah.png"},
|
|
32
|
+
{"title": "Layout", "url": "layout-and-design/index", "icon": "sherullah.png"},
|
|
33
|
+
{"title": "Reference", "url": "reference/index", "icon": "sherullah.png"},
|
|
34
|
+
],
|
|
35
|
+
"default_theme_mode": "auto",
|
|
36
|
+
"show_prev_next": True,
|
|
37
|
+
"show_toc": True,
|
|
38
|
+
"toc_title": "Contents",
|
|
39
|
+
"show_search": True,
|
|
40
|
+
"search_placeholder": "Search",
|
|
41
|
+
"show_fullscreen_button": True,
|
|
42
|
+
"show_theme_toggle": True,
|
|
43
|
+
"content_max_width": "860px",
|
|
44
|
+
"footer_author": "Sherullah Mohtat",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
48
|
+
pygments_style = "default"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Configuration
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
Every visual element of ``mohtat-sphinx-theme`` can be tailored in ``conf.py`` via ``html_theme_options`` without editing HTML templates.
|
|
5
|
+
|
|
6
|
+
.. toctree::
|
|
7
|
+
:maxdepth: 2
|
|
8
|
+
|
|
9
|
+
theme-options
|
|
10
|
+
tab-bar-and-icons
|
|
11
|
+
navigation-and-search
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Navigation and Search
|
|
2
|
+
=====================
|
|
3
|
+
|
|
4
|
+
Left Sidebar Navigation Tree
|
|
5
|
+
----------------------------
|
|
6
|
+
|
|
7
|
+
The left sidebar renders Sphinx's global ``toctree`` with progressive enhancements in ``theme.js``:
|
|
8
|
+
|
|
9
|
+
- **Independent Section Toggles**: Any parent item with nested children receives a dedicated chevron button (``v`` / ``^``) on the right so users can expand or collapse branches without navigating away from the current page.
|
|
10
|
+
- **Active State Styling**: The current page and its active ancestor branch display a tinted blue surface, accent text, and a ``3px`` left accent bar.
|
|
11
|
+
- **Desktop Collapse**: Clicking the hamburger icon (``☰``) in the sticky toolbar collapses or restores the left sidebar on desktop viewports, saving the state in ``localStorage``.
|
|
12
|
+
|
|
13
|
+
Previous and Next Cards
|
|
14
|
+
-----------------------
|
|
15
|
+
|
|
16
|
+
At the bottom of every content page (when ``show_prev_next`` is enabled), rounded ``Previous`` and ``Next`` cards link sequentially through your ``toctree``. On desktop they sit in a balanced two-column grid; on mobile screens under ``600px`` they stack cleanly into one column.
|
|
17
|
+
|
|
18
|
+
Instant Command-Palette Search
|
|
19
|
+
------------------------------
|
|
20
|
+
|
|
21
|
+
Pressing ``Cmd + K`` (macOS) or ``Ctrl + K`` (Windows/Linux), clicking the sidebar search pill, or tapping the magnifying glass icon on mobile opens the centered search modal.
|
|
22
|
+
|
|
23
|
+
How Instant Search Works Offline and Online
|
|
24
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
25
|
+
|
|
26
|
+
1. On first open, ``theme.js`` loads Sphinx's generated ``searchindex.js`` via a ``<script>`` tag and hooks ``Search.setIndex``.
|
|
27
|
+
2. Because it uses Sphinx's native JSONP callback rather than ``fetch()``, instant results work over both ``http(s)://`` and local ``file://`` builds.
|
|
28
|
+
3. Use ``ArrowDown``, ``ArrowUp``, and ``Enter`` to jump directly to a result, or press ``Enter`` with no selection to open the full ``search.html`` results page.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
Tab Bar and Icons (sherullah.png)
|
|
2
|
+
===================================
|
|
3
|
+
|
|
4
|
+
``mohtat-sphinx-theme`` bundles ``sherullah.png`` in its ``static/`` directory and wires it into three complementary places so your icon renders reliably across desktop, mobile, and browser tabs.
|
|
5
|
+
|
|
6
|
+
1. Browser Tab Favicon
|
|
7
|
+
----------------------
|
|
8
|
+
|
|
9
|
+
By default, ``templates/layout.html`` emits ``<link rel="icon">``, ``<link rel="shortcut icon">``, and ``<link rel="apple-touch-icon">`` pointing to ``_static/sherullah.png`` (or whichever filename is set in ``tab_bar_icon``). If you set Sphinx's ``html_favicon`` explicitly, that custom URL takes precedence.
|
|
10
|
+
|
|
11
|
+
2. Top Header Tab Bar
|
|
12
|
+
---------------------
|
|
13
|
+
|
|
14
|
+
Inside ``templates/partials/tabbar.html``, each item in ``tab_bar_items`` renders an ``18px × 18px`` circular ``sherullah.png`` icon alongside its label:
|
|
15
|
+
|
|
16
|
+
.. code-block:: python
|
|
17
|
+
|
|
18
|
+
html_theme_options = {
|
|
19
|
+
"show_tab_bar": True,
|
|
20
|
+
"tab_bar_icon": "sherullah.png",
|
|
21
|
+
"tab_bar_items": [
|
|
22
|
+
{"title": "Overview", "url": "index", "icon": "sherullah.png"},
|
|
23
|
+
{"title": "Getting Started", "url": "getting-started/index", "icon": "sherullah.png"},
|
|
24
|
+
{"title": "Configuration", "url": "configuration/index", "icon": "sherullah.png"},
|
|
25
|
+
],
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
On desktop viewports, the tab bar sits aligned cleanly on the right of the dark top bar. On narrow mobile viewports, it remains compact and horizontally scrollable without wrapping or colliding with the toolbar below.
|
|
29
|
+
|
|
30
|
+
3. In-Page Content Tab Bars
|
|
31
|
+
---------------------------
|
|
32
|
+
|
|
33
|
+
When ``mohtat_sphinx_theme`` is listed in ``extensions``, you can use the ``.. tab-bar::`` and ``.. tab-item::`` directives directly inside reStructuredText pages. Every tab button defaults to ``sherullah.png`` if ``:icon:`` is omitted:
|
|
34
|
+
|
|
35
|
+
.. tab-bar::
|
|
36
|
+
|
|
37
|
+
.. tab-item:: Desktop Layout
|
|
38
|
+
:icon: sherullah.png
|
|
39
|
+
:selected:
|
|
40
|
+
|
|
41
|
+
Tab buttons display the ``sherullah.png`` avatar cleanly beside each tab label and support ``ArrowLeft`` / ``ArrowRight`` keyboard navigation.
|
|
42
|
+
|
|
43
|
+
.. tab-item:: Mobile Layout
|
|
44
|
+
:icon: sherullah.png
|
|
45
|
+
|
|
46
|
+
The tab strip scrolls horizontally on narrow screens while preserving crisp borders and active bottom-underline indicators.
|
|
47
|
+
|
|
48
|
+
.. tab-item:: Custom Icon Override
|
|
49
|
+
:icon: sherullah.png
|
|
50
|
+
|
|
51
|
+
Pass ``:icon: your-asset.png`` on any individual ``.. tab-item::`` to override the static icon for that tab alone.
|
|
52
|
+
|
|
53
|
+
Directive Syntax
|
|
54
|
+
----------------
|
|
55
|
+
|
|
56
|
+
.. code-block:: rst
|
|
57
|
+
|
|
58
|
+
.. tab-bar::
|
|
59
|
+
|
|
60
|
+
.. tab-item:: First Tab
|
|
61
|
+
:icon: sherullah.png
|
|
62
|
+
:selected:
|
|
63
|
+
|
|
64
|
+
Content for the first tab.
|
|
65
|
+
|
|
66
|
+
.. tab-item:: Second Tab
|
|
67
|
+
:icon: sherullah.png
|
|
68
|
+
|
|
69
|
+
Content for the second tab.
|