On 25 March 2015 at 09:20, Ken McGlothlen <[email protected]> wrote: > > > On Monday, March 23, 2015 at 1:18:46 AM UTC-7, Lex Trotman wrote: >> >> On 23 March 2015 at 18:45, Marco Ciampa <[email protected]> wrote: >> > On Mon, Mar 23, 2015 at 10:00:21AM +1100, Lex Trotman wrote: >> >> Since the HTMLs are generated directly by Asciidoc there is no >> >> toolchain to do that. Asciidoc itself can't because it is a streaming >> >> processor that does not load the whole document in one go. >> > [...] >> > THAT is a big limit! >> >> > Why not converting it in a 2 pass and do away with javascript? >> >> [...] >> >> And the docbook xslt toolchain produces html without javascript. > > > Len, is there an example of how to use the DocBook XSLT toolchain with all > this? I'd like to be able to use that, and to produce PDFs, but it's taking > me a while to get to it, and an example would be very useful.
The easiest way of using the toolchains (at least ones others have used) is to use the a2x script that is part of the asciidoc distribution http://asciidoc.github.io/asciidoc/a2x.1.html > > As far as the two-pass asciidoc, it's not technically necessary. As Lex > mentions, other toolchains do this. But there's also another way to do it. > > I'm writing a Python script which pulls useful information from the HTML > output, and then modifies the original AsciiDoc file with anchor labels and > whatnot. In a sense, that's the first-pass part as an external script, and > so far, it seems to be working quite well. You can implement default labels > at the section level, or override them inside the document. The resulting > labels are written into the anchors in the AsciiDoc file as labels (which > are ignored by the html5 backend), and then all the links that refer to > those same anchors are rewritten with the labels if necessary. Well the pedantic among us (Hi all) would say that this *is* a second pass, just that it happens before the asciidoc pass :) Just a hint, don't forget a way of escaping the substitution, otherwise you won't be able to have any text that might happen to match a cross reference inside a listing or other literal location where you would want it passed through unchanged. Unless you parse the asciidoc file enough to detect those locations yourself. Cheers Lex > > The script is still being worked on, but I'm pretty pleased with how it's > going. I can do a fuller writeup later if anyone's interested. > > —Ken > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/asciidoc. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/asciidoc. For more options, visit https://groups.google.com/d/optout.
