Expand description
Unified showcase infrastructure for facet format crates.
This crate provides consistent rendering for showcases across all facet format crates (JSON, YAML, KDL, etc.), supporting both terminal output and HTML generation for the website.
§Example
ⓘ
use facet_showcase::{ShowcaseRunner, Language};
let mut runner = ShowcaseRunner::new("JSON Error Showcase");
runner.scenario("Unknown Field")
.description("JSON contains a field that doesn't exist in the target struct.")
.input(Language::Json, r#"{"username": "alice", "emial": "test@example.com"}"#)
.target_type::<User>()
.error(&err)
.finish();
runner.finish();Structs§
- Highlighter
- Syntax highlighter using Tokyo Night theme.
- Provenance
- Build provenance information for tracking where showcase output came from.
- Scenario
- A single scenario within a showcase.
- Showcase
Runner - Main entry point for running showcases.
Enums§
- Language
- Supported languages for syntax highlighting.
- Output
Mode - Output mode for showcase rendering.
Functions§
- ansi_
to_ html - Convert ANSI escape codes to HTML spans with inline styles. Uses non-breaking spaces to preserve alignment in monospace output.
- html_
escape - Escape HTML special characters.