SRFI AsciiDoc->HTML converter Lassi Kortela (09 Sep 2019 10:56 UTC)
Re: SRFI AsciiDoc->HTML converter Duy Nguyen (09 Sep 2019 11:05 UTC)
Re: SRFI AsciiDoc->HTML converter Lassi Kortela (09 Sep 2019 11:17 UTC)
Re: SRFI AsciiDoc->HTML converter Duy Nguyen (09 Sep 2019 11:25 UTC)
Re: SRFI AsciiDoc->HTML converter Lassi Kortela (09 Sep 2019 11:41 UTC)
Re: SRFI AsciiDoc->HTML converter John Cowan (09 Sep 2019 13:05 UTC)
SXML in general Lassi Kortela (09 Sep 2019 13:18 UTC)
Re: SXML in general John Cowan (09 Sep 2019 13:20 UTC)
Re: SXML in general Lassi Kortela (09 Sep 2019 13:31 UTC)
Re: SXML in general John Cowan (09 Sep 2019 14:06 UTC)

Re: SRFI AsciiDoc->HTML converter Lassi Kortela 09 Sep 2019 11:17 UTC

> Off topic. But if anyone wants to write in markdown instead,
> commonmark can export to xml. You can do some extra processing in sxml
> before transforming to html, which is not that complicated with
> pre-post-order [1]
>
> [1] https://gitlab.com/pclouds/cuibap/blob/master/cuibap/commonmark.scm#L50

Cool! It'd be great if the tool could be extended to handle Markdown in
addition to AsciiDoc. I prefer AsciiDoc because it has more solid
support for advanced features like tables, but Markdown is more popular.

The tool:

1. Runs `asciidoctor` to turn AsciiDoc into HTML.
2. Uses (chibi html-parser) to turn the HTML into SXML.
3. Does tree transforms to remove asciidoctor boilerplate from the SXML.
4. Uses (chibi sxml) to turn that SXML back into HTML.
5. Runs `tidy` to normalize the HTML and writes it into a .html file.

So the parts before the tree transforms could be done using commonmark
if the source filename ends in ".md" instead of ".adoc".

What is the tree transform library you are using in cuibap? I
hand-rolled my own transformation primitives for this program. It'd be
great to have a portable transformer lib in Snow.