https://github.com/ayosec/asciidoctor-xml-ast
Converter for Asciidoctor syntax to XML
https://github.com/ayosec/asciidoctor-xml-ast
asciidoctor asciidoctor-converter
Last synced: 8 months ago
JSON representation
Converter for Asciidoctor syntax to XML
- Host: GitHub
- URL: https://github.com/ayosec/asciidoctor-xml-ast
- Owner: ayosec
- License: mit
- Created: 2022-07-07T21:09:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-07T23:04:02.000Z (over 3 years ago)
- Last Synced: 2025-01-07T12:13:13.336Z (9 months ago)
- Topics: asciidoctor, asciidoctor-converter
- Language: Ruby
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asciidoctor-ast-xml
This repository implements an [Asciidoctor converter] to generate a XML file
with the syntax nodes of a parsed document.## Usage
The converter is available as a Ruby gem, and can be installed with the
following command:```console
$ gem install asciidoctor-xml-ast
```The gem includes the executable `asciidoctor-xml-ast`, which you can use instead
of `asciidoctor`:```console
$ asciidoctor-xml-ast document.adoc
```Alternatively, you can invoke `asciidoctor` directly, and add the options
`--require asciidoctor-ast-xml` and `--backend xml-ast`:```console
$ asciidoctor -r asciidoctor-xml-ast -b xml-ast document.adoc
```In the previous examples, the output will be in the `document.ast.xml` file.
## Example
The following document:
```asciidoc
= Lorem Ipsum== Dolor Sit Amet
Cillum dolore eu *fugiat* nulla pariatur
```Generates a XML like this:
```xml
Cillum dolore eu fugiat nulla pariatur
```
The `` element contains a lot of attributes, which have been removed
in this example so it is easier to read.The actual output is not indented. The previous example is formatted with [xmllint].
[Asciidoctor converter]: https://docs.asciidoctor.org/asciidoctor/latest/convert/
[xmllint]: https://gnome.pages.gitlab.gnome.org/libxml2/xmllint.html