moonbit-brandbook is a MoonBit library and CLI demo for generating brand
guidelines from structured design tokens. It renders Markdown and static HTML,
and it audits a brand specification before export.
The project was created for the MoonBit August hackathon as a reusable design
system documentation tool. It is intentionally small at the edges and broad in
the core: tokens, components, validation, Markdown output, HTML output, and CLI
demonstration are separate concerns.
Features
Logo usage rules: minimum size, clear space, allowed backgrounds.
Color tokens: semantic roles, CSS custom properties, Markdown tables.
Typography tokens: font stacks and type scale.
Component examples: anatomy, token dependencies, interaction states.
Incorrect usage examples with replacement guidance.
Static Markdown and HTML renderers.
CSS custom property export for color and typography tokens.
Color contrast helpers for foreground/background pairs.
Audit report for missing or malformed brand data.
Usage
Run the demo CLI:
moon run cmd/main
Use the library in MoonBit:
test {
let book = moonbit_brandbook()
let report = book.audit()
inspect(report.summary(), content="0 errors, 0 warnings, 0 notes")
assert_true(book.to_markdown().contains("## Logo Usage"))
assert_true(book.to_css().contains("--brand-rabbit-blue"))
}
Validation
moon check
moon test
moon fmt --check
moon check --deny-warn
moon test --deny-warn
moon info
git diff --exit-code
Scope
The current implementation focuses on deterministic generation from in-memory
tokens. Future extensions can add JSON/YAML input, richer image asset checks,
theme exports, and package publishing to mooncakes.io.
Source And Authorship
All source files in this repository are authored for this hackathon submission
by the repository owner. The bundled MoonBit sample brand tokens are
hand-authored demonstration data, not copied from an official brand manual.
License
Apache-2.0
关于
MoonBit brand guideline generator for Markdown, HTML, CSS tokens, and audits
moonbit-brandbook
moonbit-brandbookis a MoonBit library and CLI demo for generating brand guidelines from structured design tokens. It renders Markdown and static HTML, and it audits a brand specification before export.The project was created for the MoonBit August hackathon as a reusable design system documentation tool. It is intentionally small at the edges and broad in the core: tokens, components, validation, Markdown output, HTML output, and CLI demonstration are separate concerns.
Features
Usage
Run the demo CLI:
Use the library in MoonBit:
Validation
Scope
The current implementation focuses on deterministic generation from in-memory tokens. Future extensions can add JSON/YAML input, richer image asset checks, theme exports, and package publishing to mooncakes.io.
Source And Authorship
All source files in this repository are authored for this hackathon submission by the repository owner. The bundled MoonBit sample brand tokens are hand-authored demonstration data, not copied from an official brand manual.
License
Apache-2.0