All converters implement the Visitor trait from core/src/visitor.rs.
Shared utilities in core/:
substitutions.rs— typography replacements, escape handlingsection.rs— section numbering and hierarchytable.rs— table layout calculations (colspan/rowspan)code.rs— syntax highlighting integrationtoc.rs— table of contents generation
acdc-converters-core::substitutions::SubsFlags,effective_subs,effective_subs_flags, andapply_replacementsonly exist when thepre-spec-subsfeature is enabled (default-on). When the feature is off,[subs="…"]is silently ignored at the parser layer and converters fall back to the asciidoctor default (all substitutions on).- The markdown converter does not honour
subs=and intentionally has nopre-spec-subsfeature in itsCargo.toml. Don't treat that as a regression to fix — markdown's output model doesn't need it. - HTML uses a separate
Vec<Substitution>path returned byeffective_subs(...)at shallow block sites (html/src/html_visitor.rs). - Terminal and manpage carry an
Rc<Cell<SubsFlags>>on theirProcessorfor the deep inline hot path. Thecurrent_subsfield, its initialisers, and the paragraph snapshot/restore are all#[cfg(feature = "pre-spec-subs")]. The PlainText arm calls a smalltransform_plainhelper that has two definitions (feature on/off) so the call site stays clean. - When adding a new converter that honours
subs=: forward the feature inCargo.toml(pre-spec-subs = ["acdc-parser/pre-spec-subs", "acdc-converters-core/pre-spec-subs"]), follow the manpage shape (snapshot/restore inrender_paragraph, querycurrent_subs.get()in the PlainText arm), and gate both sides behind the feature. - Fixtures whose expected output depends on
subs=must includesubsin their stem (convention:subs_…). Under--no-default-features:- The html and manpage harnesses use rstest glob discovery and
early-return in their
run_*_fixturehelper whenfile_name.contains("subs"). - The terminal harness uses an explicit
generate_tests!macro list, not glob discovery. Subs fixtures must be registered in that list explicitly, andtest_fixturehas the matching.contains("subs")early-return.
- The html and manpage harnesses use rstest glob discovery and
early-return in their
- Use
compare-asciidoc-outputagent to diff converter output against asciidoctor - For fixture mismatches, run
regen-fixturesskill (ask first)
cargo run -p acdc-converters-html --example generate_html_fixtures --all-features
cargo run -p acdc-converters-terminal --example generate_terminal_fixtures --all-features
cargo run -p acdc-converters-manpage --example generate_manpage_fixtures --all-features
cargo run -p acdc-converters-pdf --example generate_typst_fixtures --all-features
# Markdown uses a shell script that drives the CLI (no example binary):
bash converters/markdown/tests/regenerate_expected.sh
# Regenerate a single fixture:
bash converters/markdown/tests/regenerate_expected.sh <fixture_name>