Skip to main content

Golem Documentation

Michael Bernstein

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.

C

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)
M

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]
V

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.

Canvas
--bg-canvas
Root page background
Surface
--bg-surface
Sidebar, header, admonitions
Card
--bg-card
Pagination cards, listings
Elevated
--bg-surface-elevated
Popups, overlays, tooltips
Code
--bg-code
Pre blocks, inline 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 Note admonition, utilizing --color-note (Forest Teal). It provides supplementary context or background explanations.

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

Clay 100#fbeee6
Clay 300#eeb79b
Clay 500#d4692a
Clay 700#8b3a12
Clay 900#3e2518

Neutral Workbench Palette

Neutral 50#faf9f5
Neutral 200#ede8df
Neutral 400#cbd5e1
Neutral 600#6b5d52
Neutral 800#1e1a16
Neutral 950#090d16

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:

Example Multi-View Component
PYTHON
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}!"

Keyboard Shortcuts & UI Buttons

Inline user interface macros render tactile, elevated widgets:

  • Open Command Palette: Ctrl Shift P or Cmd Shift P
  • Quick Save: Ctrl S
  • Action Button: Rebuild Site
  • Menu Sequence: File › Export › Static HTML

Tables & Column Alignments

ParameterDescriptionTypeDefault

config

Primary configuration containing paths and plugins

GolemConfig

Required

force

When True, invalidates all cached page artifacts

bool

False

workers

Maximum parallel compilation workers

int

4