Metadata-Version: 2.4
Name: doxtr-epub-theme-core
Version: 0.4.2
Summary: Core accessible Sphinx EPUB3 theme powered by doxtr-theme-core with WCAG contrast and light/dark mode support.
Author: Jens Frey
Project-URL: Homepage, https://github.com/doxtr/doxtr-epub-theme-core
Project-URL: Repository, https://github.com/doxtr/doxtr-epub-theme-core
Project-URL: Issues, https://github.com/doxtr/doxtr-epub-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: Framework :: Sphinx :: Theme
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: doxtr-theme-core>=0.5.2
Requires-Dist: Sphinx>=7.0
Requires-Dist: Pillow>=10.0
Dynamic: license-file

# doxtr-epub-theme-core

Core accessible Sphinx EPUB3 theme powered by `doxtr-theme-core`.

## Features

- Consumes brand specs (`ColorPalette`, `FontSpec`, `BrandConfig`) from `doxtr-theme-core`
- Emits EPUB3-compatible hex CSS variables (`light`, `dark`, and `auto` modes via `prefers-color-scheme` and reader dark-mode selectors)
- Enforces WCAG contrast across semantic palette tokens, Pygments syntax CSS, and SVG covers
- Automatically pairs user `-dark` / `_dark` assets or adapts bright raster/SVG diagrams while preserving strict XHTML validity
- Generates an accessible SVG EPUB cover with shared `doxtr-theme-core` icon fallback

## Installation

```bash
pip install doxtr-epub-theme-core
```

## Usage

### Auto-Loading via `epub_theme` (No `extensions` Entry Needed)

```python
# conf.py
epub_theme = "doxtr_epub_core"  # or "doxtr_epub_theme_core"
```

### Explicit Extension or Multi-Format Suite

```python
extensions = ["doxtr_epub_theme_core"]
epub_theme = "doxtr_epub_core"
```

## Mixing & Matching Themes per Format

Pair `doxtr_epub_core` EPUB output with another HTML or PDF theme (or keep Sphinx's default `epub_theme = "epub"` when using `doxtr_theme_*`):

```python
extensions = ["doxtr_pdf_theme_aubergine"]
html_theme = "pydata_sphinx_theme"
epub_theme = "doxtr_epub_core"
```

## Sharing One Color Theme Across Different Layout Themes

Set `doxtr_semantic_palette` (or load a brand extension like `doxtr_theme_aubergine`) alongside `epub_theme = "doxtr_epub_core"` so HTML, PDF, and EPUB share the same palette across different layouts:

```python
extensions = ["doxtr_theme_aubergine"]
epub_theme = "doxtr_epub_core"  # Core EPUB layout styled with Aubergine colors
```

## Preview

Rendered from [doxamples](https://github.com/doxtr/doxamples).

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

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

