8个版本 (5个重大更新)

0.6.0 2024年6月7日
0.5.1 2024年5月31日
0.4.0 2024年4月24日
0.3.3 2024年4月17日
0.1.0 2024年3月28日

#234 in 文本处理

MIT 许可证

415KB
13K SLoC

🤓 Asciidork

用Rust编写的Asciidoc解析器/后端

安装

# requires rust/cargo toolchain
cargo install asciidork-cli
或从源安装
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

用法

# 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

Asciidork解析器和dr-html后端编译为WASM,可在浏览器中运行!(我提到它是用Rust编写的吗?) NPM软件包即将推出,但你现在可以在这里看到它的实际运行情况

https://asciidork-playground.vercel.app

确保弹出开发者工具以查看计时信息。

注意事项

[!WARNING] Asciidork尚未完成。它实现了Asciidoc的大部分文档行为,但还有一些未完成区域,缺少错误处理,有很多边缘情况!目前仅将其视为技术预览。

已知的未完成或未实现区域包括

  • CSV表格
  • STEM
  • 源代码高亮显示
  • 包含指令
  • 所有实体引用

欢迎PR!👍

依赖项

~4–15MB
~135K SLoC