Files
komorebi/Cargo.toml
T
LGUG2Z c85edf242f feat(docgen): initial implementation of html doc generator
Implement a complete Rust library and CLI tool for generating self-contained
HTML documentation from schemars::Schema (JSON Schema) objects.

Core Features:
- Library API with `generate_html()` function and `Options` struct
- CLI binary accepting JSON Schema input files with optional title override
- Tera-based HTML templating with base template and reusable macros
- Markdown rendering for schema descriptions via pulldown-cmark
- Dark/light theme support following system preferences
- Searchable properties with instant search functionality
- Collapsible nested structures for complex schemas
- Responsive design for mobile, tablet, and desktop

Library Components:
- `generator.rs`: Main HTML generation logic with Tera template engine
- `prepare.rs`: Schema preprocessing for template rendering (1667 lines)
- `lib.rs`: Public API with SchemaExt trait for typed schema accessors
- `main.rs`: CLI interface using clap for argument parsing

Template System:
- `base.html`: Main HTML structure with header, sidebar, and content areas
- `macros.html`: Reusable Tera macros for rendering schema components
- `style.css`: Complete CSS with CSS variables for theming (955 lines)
2025-12-22 09:31:19 -08:00

27 lines
530 B
TOML

[package]
name = "schemars-docgen"
version = "0.1.0"
edition = "2024"
description = "Generate HTML documentation from schemars::Schema objects"
license-file = "LICENSE.md"
[lib]
name = "schemars_docgen"
path = "src/lib.rs"
[[bin]]
name = "schemars-docgen"
path = "src/main.rs"
[dependencies]
schemars = "1.1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tera = "1.19"
pulldown-cmark = "0.12"
clap = { version = "4", features = ["derive"] }
thiserror = "2"
[dev-dependencies]
pretty_assertions = "1.4"