Crate facet_showcase

Crate facet_showcase 

Source
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 powered by arborium.
Provenance
Build provenance information for tracking where showcase output came from.
Scenario
A single scenario within a showcase.
ShowcaseRunner
Main entry point for running showcases.

Enums§

Language
Supported languages for syntax highlighting.
OutputMode
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.