Expand description
Proc macros for Standout.
This crate provides macros for compile-time resource embedding and declarative command dispatch configuration.
§Available Macros
§Embedding Macros
embed_templates!- Embed template files (.jinja,.jinja2,.j2,.txt)embed_styles!- Embed stylesheet files (.yaml,.yml)
§Derive Macros
Dispatch- Generate dispatch configuration from clapSubcommandenumsTabular- GenerateTabularSpecfrom struct field annotationsTabularRow- Generate optimized row extraction without JSON serializationSeekable- Generate query-enabled accessor functions for Seeker
§Design Philosophy
These macros return EmbeddedSource types that contain:
- Embedded content (baked into binary at compile time)
- Source path (for debug hot-reload)
This design enables:
- Release builds: Use embedded content, zero file I/O
- Debug builds: Hot-reload from disk if source path exists
§Examples
For working examples, see:
standout/tests/embed_macros.rs- embedding macrosstandout/tests/dispatch_derive.rs- dispatch derive macro
Macros§
- embed_
styles - Embeds all stylesheet files from a directory at compile time.
- embed_
templates - Embeds all template files from a directory at compile time.
Derive Macros§
- Dispatch
- Derives dispatch configuration from a clap
Subcommandenum. - Seekable
- Derives the
Seekabletrait for query-enabled structs. - Tabular
- Derives a
TabularSpecfrom struct field annotations. - Tabular
Row - Derives optimized row extraction for tabular formatting.