4 releases (breaking)

0.10.0 Nov 15, 2024
0.8.0 Oct 25, 2024
0.7.0 Oct 14, 2024
0.5.1 May 31, 2024

#320 in Filesystem

Download history 12/week @ 2024-08-16 11/week @ 2024-08-23 12/week @ 2024-08-30 13/week @ 2024-09-06 13/week @ 2024-09-13 16/week @ 2024-09-20 10/week @ 2024-09-27 3/week @ 2024-10-04 187/week @ 2024-10-11 40/week @ 2024-10-18 151/week @ 2024-10-25 36/week @ 2024-11-01 8/week @ 2024-11-08 154/week @ 2024-11-15 29/week @ 2024-11-22 20/week @ 2024-11-29

217 downloads per month
Used in 6 crates (5 directly)

MIT license

38KB
1K 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
  • All entity refs

PRs welcome! 👍

Dependencies

~10KB