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:41 UTC

>> 4. Uses (chibi sxml) to turn that SXML back into HTML.
>
> Yeah. commonmark does not produce "html in xml tags" though. So step 4
> may need some more work. The good thing is html export from sxml (at
> least Gauche version) is pretty clean.

(chibi html-parser) is lenient, so it can handle HTML that isn't XHTML.
It's a bit confused by some HTML tags like <meta> that don't have
closing tags in classic HTML, but those are not hard to fix by hand.
There's also a similar library called "htmlprag" which I haven't tried.
I handle all this in the parsing stage, so the SXML->HTML generation
only needs to call Alex's library.

> If I remember correctly the sxml library produces broken html5 tags
> sometimes [1], maybe that's why you need 'tidy'?

I use `tidy` to get consistent whitespace (indentation, paragraph
wrapping, etc.) It's very strict about style and normalizes a lot of
things, which I like because then I don't need to make any decisions
about those things. Arthur also prefers to use `tidy` where it's OK with
the SRFI author, so it's a natural choice.

I think the SXML->HTML phase produces valid HTML 5 even by itself (I
just add the "<!doctype html>" at the beginning). There may be subtle
corner cases where it breaks; I'm not a HTML/XML expert.

> pre-post-order function is part of sxml (or maybe sxpath?) library.
> For Gauche it's in sxml.tree-trans library. I think I've seen it in a
> couple other Scheme implementations too.
> https://wingolog.org/pub/fold-and-xml-transformation.pdf could be a
> good read about it (and another thing).

Great, thanks. I'll read up on those. There seem to be lots of Scheme
SXML libraries already; it's just a matter of organizing them.

If someone can explain the current SXML situation to us, please chime in :)