But more importantly, unlike the various Markdown flavors or AsciiDoc, it is incredibly extensible thanks to the combination of custom filters and the possibility to add HTML classes and attributes. One can write filters to leverage the class/attribute information and perform transformations at the AST level, which basically lets you define a DSL with an arbitrary number of custom elements.
I wrote a collection of filters for the publication of a large online legal playbook. Not only did Pandoc make it possible to introduce different kind of custom elements that don't exist in plain Markdown or AsciiDoc, but by using different filters it was possible to use a single Markdown source to generate both the book and various summaries such as a list of examples, a list of civil code clauses etc. I don't know Haskell that well so I used Rust for the filters, but that worked very well.
Pandoc is IMO a very underrated tool.
This is nebulous. Haskell's compiled binaries are not ideal, for a number of reasons.[^1] GHC does very little to optimise for many typical metrics of "efficient". The binaries it produces are enormous because it (unavoidably) bundles the runtime along with the program itself, and there is a lot of empty space in the binaries. Shrinking them can improve startup times significantly especially on spinning rust drives.
That said, Haskell programs are at least _compiled_, and they do result in binaries which, if well written, can result in running times comparable to (or, sometimes, shorter than) your average hand-rolled C code that achieves the same goals.
Of course, none of this casts any shadow on the fact that Pandoc is, indeed, an excellently engineered piece of software that stands as a testament to the value of Haskell for real-world business logic and problem solving.
[^1]: This problem is fairly well-understood in the Haskell community: https://dixonary.co.uk/small
Seems there's a long-standing (for the project) open issue where it's still being mulled over.
Imports are also very nice for writing longer texts--especially how AsciiDoc lets you +1 all of your headings so the heading hierarchy works as a standalone document and a part of a larger whole.
# Title
: key = value
```include
./examples/hello.rs
```
today and write a simple filter to extract meta from the first definition list and resolve includes.Here is how I made some reveal slides
(import [org.asciidoctor
Asciidoctor
OptionsBuilder
SafeMode])
(let [input-file (clojure.java.io/file
"path/to/adoc/file")
adoctor (org.asciidoctor.Asciidoctor$Factory/create)
reveal-option (doto
(org.asciidoctor.OptionsBuilder/options)
(.backend
"revealjs")
(.safe
org.asciidoctor.SafeMode/UNSAFE)
(.attributes
(.attribute
(org.asciidoctor.AttributesBuilder/attributes)
"revealjsdir"
"../reveal.js")))]
(.requireLibrary
adoctor
(into-array
String
["asciidoctor-revealjs"]))
(.convertFile
adoctor
input-file
reveal-option))
You get all the codez from Maven so you don't need to install anything on your system {'org.asciidoctor/asciidoctorj-revealjs {:mvn/version "5.0.0.rc1"}
'org.asciidoctor/asciidoctorj-pdf {:mvn/version "1.6.2"}
'org.asciidoctor/asciidoctorj {:mvn/version "2.5.3"}
The maintainers seem very responsive and active on Github. It's not as nice as a spec and multiple implementations - and I guess you're locked in to one library, but at least it's not as bad as Orgmode - where you're locked in to an editor as wellThough when it comes to annoyance with Markdown forks: AsciiDoctor is basically that to AsciiDoc. It's mostly compatible, but when it isn't, it really bites.