CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-sphinxawesome-theme

An awesome theme for the Sphinx documentation generator with enhanced features, custom code highlighting, and modern responsive design

Overview
Eval results
Files

theme-builder.mddocs/

Theme Builder

Custom HTML builder that extends Sphinx's StandaloneHTMLBuilder with enhanced Pygments highlighting and dark mode CSS support. The AwesomeHTMLBuilder provides advanced code highlighting features and proper handling of dual-mode (light/dark) Pygments styles.

from sphinxawesome_theme.builder import AwesomeHTMLBuilder

Capabilities

HTML Builder

Custom HTML builder that overrides Pygments CSS handling to support both light and dark mode styles in a single CSS file.

class AwesomeHTMLBuilder(StandaloneHTMLBuilder):
    """HTML builder that overrides methods related to handling CSS for Pygments."""
    
    def init_highlighter(self) -> None:
        """
        Initialize Pygments highlighters for both light and dark modes.
        
        Sets up the main highlighter based on pygments_style configuration
        and optionally creates a dark mode highlighter if pygments_style_dark
        is configured.
        """
    
    def create_pygments_style_file(self) -> None:
        """
        Create CSS file for Pygments that includes both light and dark mode styles.
        
        Generates a single pygments.css file that contains the main stylesheet
        plus dark mode styles prefixed with '.dark' selector.
        """

Types

# Attributes set by init_highlighter
highlighter: AwesomePygmentsBridge  # Main highlighter instance
dark_highlighter: AwesomePygmentsBridge | None  # Dark mode highlighter if configured

Install with Tessl CLI

npx tessl i tessl/pypi-sphinxawesome-theme

docs

code-highlighting.md

deprecated-options.md

html-postprocessing.md

index.md

json-serialization.md

logo-management.md

template-functions.md

theme-builder.md

theme-configuration.md

toc-manipulation.md

tile.json