This is a Note admonition, utilizing --color-note (Forest Teal). It provides supplementary context or background explanations.
Design System & Component Showcase
Michael Bernstein zopemaven@gmail.com
This document serves as the living component showcase and specification for Golem's three-layer design token architecture. It exercises token rendering across light and dark themes, verifying typography, surface elevation, visual containment, API autodoc structures, and interactive documentation widgets.
1. Symbol Kind Glyph Badges (Dual Coding)
Golem employs a dual-coding visual system for language symbols: each symbol kind is distinguished by both a distinct letter glyph (C, M, F, I, T, X, V) and an accessible, WCAG AA compliant semantic color pair (foreground and background tint).
| Badge | Symbol Kind | Light Theme Color | Dark Theme Color |
|---|---|---|---|
| C | Class / Struct | #2563eb on #eff6ff |
#60a5fa on #1e3a8a44 |
| M | Method / Member Function | #7c3aed on #f5f3ff |
#a78bfa on #4c1d9544 |
| F | Function / Free Function | #92400e on #fffbeb |
#fbbf24 on #78350f44 |
| I | Interface / Protocol / Trait | #047857 on #ecfdf5 |
#34d399 on #064e3b44 |
| T | Type / TypeAlias / Enum | #0e7490 on #ecfeff |
#22d3ee on #164e6344 |
| X | Exception / Error | #b91c1c on #fef2f2 |
#f87171 on #7f1d1d44 |
| V | Variable / Constant / Attribute | #475569 on #f1f5f9 |
#94a3b8 on #33415544 |
2. Structural Containment & Left-Rail Hierarchy
According to Principle 3, member methods, attributes, and inner types are grouped within a parent symbol using left-rail visual indentation (.doc-member). When focused or hovered, the active rail dynamically shifts from --border-rail to --border-rail-active.
BuildEngine
The primary DAG compilation orchestrator responsible for incremental page synthesis.
class BuildEngine(
config: GolemConfig,
staleness_tracker: StalenessTracker = None,
):
View Source
class BuildEngine:
"""Orchestrates AsciiDoc parsing, template composition, and artifact writing."""
def __init__(self, config: GolemConfig, staleness_tracker: Optional[StalenessTracker] = None):
self.config = config
self.staleness_tracker = staleness_tracker or StalenessTracker(config)
compile_all()
Executes an end-to-end incremental rebuild of all stale AsciiDoc documents.
def compile_all(
self,
force: bool = False,
) -> list[Path]:
View Source
def compile_all(self, force: bool = False) -> list[Path]:
stale_files = self.staleness_tracker.get_outdated_files() if not force else self.all_files
return [self.compile_page(f) for f in stale_files]
staleness_tracker
Instance tracking file hashes, mtimes, and include dependencies for incremental builds.
staleness_tracker: StalenessTracker
3. Monospace Signature Blocks & Source Drawer
Autodoc signature containers (.signature-container) provide monospace, token-highlighted function and method definitions that render with high legibility across themes.
async def stream_diagnostics(
engine: BuildEngine,
channel: AsyncIterator[str],
timeout: float = 30.0,
) -> AsyncGenerator[DiagnosticEvent, None]:
View Source Implementation
async def stream_diagnostics(
engine: BuildEngine,
channel: AsyncIterator[str],
timeout: float = 30.0,
) -> AsyncGenerator[DiagnosticEvent, None]:
async with asyncio.timeout(timeout):
async for line in channel:
yield parse_diagnostic(line)
4. Typography Scale & Surface Elevations
The typographic scale combines Adobe's *Source Serif 4 for display and prose, Source Sans 3 for navigation and UI chrome, and Source Code Pro* for code listings and signatures.
--bg-canvas
--bg-surface
--bg-card
--bg-surface-elevated
--bg-code
Heading Scale Demonstration
The following sections illustrate heading styles from H1 down to H6:
Heading 1 (2.1rem Display Serif)
Heading 2 (1.55rem Display Serif with Underline)
Heading 3 (1.25rem Display Serif)
Heading 4 (1.05rem Sans UI Bold)
Heading 5 (0.90rem Sans UI Uppercase Tracked)
Heading 6 (0.80rem Sans UI Sub-heading)
Prose paragraph with bold text, italicized phrases, inline_code_identifiers, and a hyperlink to home
demonstrating subtle underline styling and focus ring contrast.
5. Admonition Callouts
Golem formats all 5 standard AsciiDoc admonition types with custom semantic colors and uppercase labels:
This is a Tip admonition, utilizing --color-tip (Olive Green). It highlights best practices, keyboard shortcuts, or performance recommendations.
This is an Important admonition, utilizing --color-important (Terracotta Clay). It flags essential prerequisites and crucial requirements.
This is a Warning admonition, utilizing --color-warning (Warm Amber Yellow). It cautions users against unintended consequences or deprecated interfaces.
This is a Caution admonition, utilizing --color-caution (Crimson Red). It alerts readers to potentially destructive operations or security risks.
6. Color Tokens & Palettes
The Golem color system is organized into primitive palettes and semantic mappings.
Fired Clay Brand Palette
Neutral Workbench Palette
7. Interactive UI & Multi-View Code Listings
Multi-View Listing Tabs (Zero-JS)
Code listings support tabbed switching (e.g. Source, ASG, and Preview) through pure CSS :has() pseudo-class selectors:
def greet(name: str) -> str:
"""Return a warm greeting."""
return f"Hello, {name}!"def greet(name: str) -> str: """Return a warm greeting.""" return f"Hello, {name}!"
Tables & Column Alignments
| Parameter | Description | Type | Default |
|---|---|---|---|
| Primary configuration containing paths and plugins |
| Required |
| When |
|
|
| Maximum parallel compilation workers |
|
|