Metadata-Version: 2.4
Name: doxtr-theme-core
Version: 0.5.0
Summary: Universal theme core foundation (palettes, color DSL, dark mode, fonts, stylebox, brand orchestration) across HTML, PDF, and future renderers.
Author: Jens Frey
Project-URL: Homepage, https://github.com/doxtr/doxtr-theme-core
Project-URL: Repository, https://github.com/doxtr/doxtr-theme-core
Project-URL: Issues, https://github.com/doxtr/doxtr-theme-core/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: Sphinx :: Extension
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Documentation :: Sphinx
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sphinx>=7.0
Requires-Dist: docutils>=0.19
Dynamic: license-file

# doxtr-theme-core

Universal multi-target theme foundation for the `doxtr` Sphinx ecosystem.

Provides shared primitives for HTML (`doxtr-html-theme-core`), PDF (`doxtr-pdf-theme-core`), EPUB (`doxtr-epub-theme-core`), brand suites (`doxtr-theme-aubergine`), Confluence, and future renderers:

- Typed `ThemeSpec`, `ColorPalette`, `FontSpec`, and `BrandConfig` contracts
- `dd:` dynamic color expression engine + WCAG AA/AAA contrast helpers + CSS token emission
- Unified light/dark mode state (`doxtr_color_scheme` / `doxtr_dark_mode`) and `_dark` asset swapping
- Unified font registration (`LaTeX` + `@font-face` CSS stacks)
- Universal `.. stylebox::` directive (HTML, LaTeX, Confluence)
- Brand-to-renderer orchestration (`setup_brand_theme`, `activate_brand_theme`) with automatic `-core` fallback and `-user` renderer compatibility
- AI authoring agent style guidance (`get_ai_style_guidance`)

## Loading Themes

`doxtr-theme-core` supports both Sphinx's native theme entry points (no `extensions` needed for HTML/EPUB) and full multi-format brand orchestration:

- **Single-format auto-loading (`html_theme` / `epub_theme`)**:
  ```python
  # conf.py — works just like pydata_sphinx_theme
  html_theme = "doxtr_core"            # or "doxtr_aubergine"
  epub_theme = "doxtr_epub_core"       # or "doxtr_epub_aubergine"
  ```
- **Multi-format brand suite (`extensions`)** (needed when PDF/LaTeX output is also built, because Sphinx only auto-loads HTML/EPUB themes from `html_theme` / `epub_theme`):
  ```python
  extensions = ["doxtr_theme_aubergine"]
  ```

## Mixing & Matching Themes per Format

Use independent layout themes for HTML, PDF, and EPUB in `conf.py`:

```python
# PyData HTML + Aubergine PDF + Core EPUB
extensions = ["doxtr_pdf_theme_aubergine"]
html_theme = "pydata_sphinx_theme"
epub_theme = "doxtr_epub_core"
```

Or override individual renderers on top of a brand suite:

```python
extensions = ["doxtr_theme_aubergine"]
doxtr_html_renderer = "doxtr_html_theme_core"   # or html_theme = "doxtr_core" / "none" to skip
doxtr_pdf_renderer = "doxtr_pdf_theme_core"
doxtr_epub_renderer = "doxtr_epub_theme_core"
```

## Sharing One Color Theme Across Different Layout Themes

Because color palettes and typography live cleanly in `doxtr-theme-core`, different HTML, PDF, and EPUB layout themes automatically share the same light/dark colors and `dd:` expressions:

```python
# Core HTML + Aubergine PDF + Core EPUB, all styled with your brand colors
extensions = ["doxtr_theme_core", "doxtr_pdf_theme_aubergine"]
html_theme = "doxtr_core"
epub_theme = "doxtr_epub_core"
doxtr_semantic_palette = {
    "primary": "#0F4C81",
    "secondary": "#1D4ED8",
    "accent": "#EA580C",
    "dark": {"primary": "#93C5FD", "page": "#0F172A"},
}
```

Or share a reusable `ThemeSpec` brand (such as `doxtr_theme_aubergine`) while picking different layouts per format (`html_theme = "doxtr_core"`, `extensions = ["doxtr_theme_aubergine", "doxtr_pdf_theme_core"]`).

## Preview

Rendered from [doxamples](https://github.com/doxtr/doxamples) with draft stamps enabled on PDF outputs.

| Light Mode | Dark Mode |
| --- | --- |
| ![Core HTML Light](previews/doxamples-core-html-light.png) | ![Core HTML Dark](previews/doxamples-core-html-dark.png) |
| ![Core EPUB Light](previews/doxamples-core-epub-light.png) | ![Core EPUB Dark](previews/doxamples-core-epub-dark.png) |

- **PDF (Light):** [`previews/doxamples-core-light.pdf`](previews/doxamples-core-light.pdf)
- **PDF (Dark):** [`previews/doxamples-core-dark.pdf`](previews/doxamples-core-dark.pdf)
- **EPUB3 (Auto light/dark):** [`previews/doxamples-core.epub`](previews/doxamples-core.epub)

