Skip to content

Tidy up formatting and presentation of inline test-based worked examples #84

Description

@abegong

Summary

PR #82 (under #30) landed inline test-based worked examples: each pairs a small input corpus with a real katalyst command and its tested output, embedded into the reference / how-to / deep-dive page that owns the feature. The mechanism works and the output can't drift — but the presentation was built quickly and deserves a dedicated polish pass.

Current state

  • Two shortcodes: {{< katalyst-example >}} embeds output only (wrapped in <pre><code>); {{< katalyst-example-full >}} embeds the full corpus + command + output (Markdown via markdownify). Both read from docs/generated/examples/<id>.{txt,full.md}, produced by cmd/gendocs from internal/examples.
  • A full example renders as a narrative line, then a flat sequence of `filename` + fenced block per corpus file, then a single console fence holding $ katalyst …, stdout, stderr, and exit status N.
  • Generated check-type / inspector pages now carry both a static ## Example (a config snippet) and a ## Worked example.

Things to tidy

  • Reconcile the static ## Example with the ## Worked example on check-type pages — the worked example's Input already shows a working config, so the two overlap. Decide whether to drop/merge the static snippet where a worked example exists.
  • File presentation: the `path` + fence pattern is plain. Consider a filename caption / "card" treatment so the corpus reads as labeled files.
  • Command transcript: visually distinguish the command from its output, and present exit status N deliberately (today it's just a trailing line inside the fence).
  • Two-shortcode story: document when to use output-only vs full (how-tos use output-only, reference/deep-dive pages use full), or unify them.
  • Long corpora (e.g. inspect-collection-fields, five files) could collapse behind <details> or be trimmed.
  • House style for corpora: the convention established in Add worked examples registry with test gating and doc generation #82 (data files first; storage named .katalyst/storage/my_directory.yaml; inline checks where they fit, schema only where the example is about schemas) should be written down so future examples follow it.
  • Minor: blank-line / whitespace tightening in generated fences; language-hint consistency.

Why

These examples are a marquee feature of the docs — real, gated output that can't drift. Consistent, scannable presentation is what makes them land; the current rendering is functional but rough.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions