Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

acdc-cli

This is the main binary for the command line processor. Think of it as the equivalent to the asciidoctor tool.

Usage

cargo run --all-features -- --help

AsciiDoc toolchain

Usage: acdc <COMMAND>

Commands:
  convert  Convert AsciiDoc documents to various output formats
  inspect  Inspect AST structure of AsciiDoc documents
  tck      Run TCK compliance tests (reads JSON from stdin)
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Subcommands

convert

Convert AsciiDoc documents to various output formats (HTML, terminal).

acdc convert [OPTIONS] [FILES]...

inspect

Inspect the AST structure of AsciiDoc documents. Useful for debugging and understanding how acdc parses documents. Only available with --features inspect.

acdc inspect [OPTIONS] <FILE>

tck

Run TCK (Test Compatibility Kit) compliance tests. Reads JSON from stdin and outputs AST as JSON. Only available with --features tck.

Backends (converters) supported

Check the converters README for details.

  • html (default)

  • manpage (available with --features manpage)

  • markdown (available with --features markdown)

  • terminal (available with --features terminal)

Building an optional backend or tool

cargo build --features terminal
cargo build --features inspect
cargo build --features tck

Alternatively, you can build them all like so:

cargo build --all-features

Feature Flags

acdc-cli uses Cargo feature flags to enable optional converters and development tools. Here’s what’s available:

Output Converters

  • html (default) - HTML5 converter with Asciidoctor-compatible styling

  • manpage - Manpage converter

  • markdown - Markdown converter with CommonMark and GitHub Flavored Markdown support

  • terminal - Terminal converter with ANSI color support

Parser Options

  • setext - Enable setext-style (two-line underlined) section headers

Syntax Highlighting

  • highlighting - Enable syntax highlighting for source blocks in HTML output (uses syntect)

Development Tools

  • inspect - AST inspection tool for debugging parser output

  • tck - Technology Compatibility Kit for spec compliance testing

Feature Groups

For convenience, you can use these feature groups:

  • all-backends - Enables both HTML and terminal converters

  • dev-tools - Enables the inspect tool

  • test-tools - Enables the TCK tool

Usage Examples

Build with terminal converter:

cargo build --features terminal

Build with all backends:

cargo build --features all-backends

Build with development tools:

cargo build --features dev-tools

Build with everything:

cargo build --all-features

Built-in Dependencies

Parser dependencies (ureq for remote includes, evalexpr for expressions, encoding_rs for encoding detection) are built-in and always available. They’re core to AsciiDoc processing and don’t require feature flags.

Examples

Convert a file to HTML:

acdc convert document.adoc

Convert with terminal backend:

acdc convert --backend terminal document.adoc

Terminal output with pager disabled:

acdc convert --backend terminal --no-pager document.adoc

Convert to embeddable HTML (no DOCTYPE, html, head, body):

acdc convert --embedded document.adoc
# or short form
acdc convert -e document.adoc

Inspect document AST:

acdc inspect document.adoc --show-locations

Extra Logging

If you want more logs, especially useful if you’re troubleshooting or reporting an error, please adjust the ACDC_LOG environment variable.

ACDC_LOG=trace cargo run -- convert your-file.adoc

or if you’re running a binary already built:

ACDC_LOG=trace acdc convert your-file.adoc