Module

cli.skeleton.schema

Skeleton Schema Definition.

This module defines the data structures for site skeletons, implementing the Component Model (Identity/Mode/Data).

Key Concepts:

  • Component: Represents a page or section with Identity (type), Mode (variant), and Data (props)
  • Skeleton: The root container for the site structure
  • Cascade: Inheritance rules for nested components

Classes

Component dataclass
A component in the site structure (Page or Section). Implements the Component Model: - Identity: t…
1

A component in the site structure (Page or Section).

Implements the Component Model:

  • Identity: type (what is it?)
  • Mode: variant (how does it look?)
  • Data: props (what data does it have?)

Attributes

Name Type Description
path str
type str | None
variant str | None
props dict[str, Any]
content str | None
pages list[Component]
cascade dict[str, Any]

Methods 1

is_section
Check if this component represents a section.
0 bool
def is_section(self) -> bool

Check if this component represents a section.

Returns

bool

Skeleton dataclass
Root definition of a site skeleton.
3

Root definition of a site skeleton.

Attributes

Name Type Description
name str | None
description str | None
version str
cascade dict[str, Any]
structure list[Component]

Methods 1

from_yaml classmethod
Parse skeleton from YAML string.
1 Skeleton
def from_yaml(cls, content: str) -> Skeleton

Parse skeleton from YAML string.

Parameters 1
content str
Returns

Skeleton

Internal Methods 2
_parse_node classmethod
Recursive parser.
1 Skeleton
def _parse_node(cls, data: dict[str, Any]) -> Skeleton

Recursive parser.

Parameters 1
data dict[str, Any]
Returns

Skeleton

_parse_component classmethod
Parse a single component.
1 Component
def _parse_component(cls, data: dict[str, Any]) -> Component

Parse a single component.

Parameters 1
data dict[str, Any]
Returns

Component