27 releases (17 breaking)

new 0.20.1 Apr 24, 2025
0.18.2 Mar 24, 2025
0.13.0 Dec 31, 2024
0.10.0 Nov 15, 2024
0.1.0 Mar 28, 2024

#869 in Text processing

Download history 152/week @ 2025-01-03 159/week @ 2025-01-10 20/week @ 2025-01-17 227/week @ 2025-01-31 177/week @ 2025-02-07 103/week @ 2025-02-14 94/week @ 2025-02-21 50/week @ 2025-02-28 1/week @ 2025-03-07 141/week @ 2025-03-14 124/week @ 2025-03-21 33/week @ 2025-03-28 12/week @ 2025-04-04 5/week @ 2025-04-11 225/week @ 2025-04-18

285 downloads per month
Used in 2 crates

MIT license

93KB
2.5K SLoC

🤓 Asciidork

An Asciidoc parser/backend written in Rust

Installation

# requires rust/cargo toolchain
cargo install asciidork-cli
or install from source
git clone https://github.com/jaredh159/asciidork
cd asciidork
cargo build --release --bins

# vvvv -- OPTIONAL: or use rel path to `./target/release/asciidork` instead
sudo cp ./target/release/asciidork /usr/local/bin

Usage

# read the friendly manual
asciidork --help

# parse/convert/print from a file
asciidork --input test.adoc

# without a --input arg, it reads from stdin
echo "foo _bar_ *baz*" | asciidork
asciidork < test.adoc

# don't include enclosing document structure by passing `--embedded`
asciidork --input test.adoc --embedded

# send output to a file (alternatively just redirect stdout)
asciidork --input test.adoc --embedded --output test.html

# print information about perf (did i mention it's written in Rust btw?)
asciidork --input test.adoc --print-timings

# print pretty html (requires `pretter` -- install w/ `npm i -g prettier`)
asciidork --input test.adoc --embedded --format dr-html-prettier

WASM

The Asciidork parser and dr-html backend compiles to WASM to run in the browser! (Did I mention it's written in Rust?) NPM package coming soon, but for now you can see it in action here:

https://asciidork-playground.vercel.app

Be sure to pop the dev tools to see timing info.

Caveats

Warning

Asciidork is not complete. It implements a sizeable majority of the documented behavior of Asciidoc, but there are some unfinished areas, missing error handling, and edge cases yet unfinished.

Known unfinished or unimplemented areas include:

  • STEM
  • Source highlighting
  • Inline SVGs
  • Embedded data-uri images
  • Docinfo files

PRs welcome! 👍

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option. Any contribution intentionally submitted for inclusion in Asciidork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~255–355KB