[NTG-context] How to do code listings & sections from XML (AsciiDoc)

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri Aug 12 17:37:15 CEST 2022


Hi,

Hans helped me out with some asciidoc processing a while ago.

I played a bit further, but I'm currently facing two minor issues:

(a) I don't know how to turn program listing (verbatim code) from xml
to (perhaps, vim-based) syntax highlighting (but most importantly, to
make sure that line breaks work properly)

(b) some section titles are missing


Ad (a). The source that looks similar to this:

<programlisting language="cpp" linenumbering="unnumbered">
int main()
{
    return 0;
}
</programlisting>

should be converted into some kind of equivalent of

% on top
\usemodule[vim]
\definevimtyping [CPP] [syntax=cpp]

\startCPP
int main()
{
    return 0;
}
\stopCPP

In the attachment I have the source document (test.adoc), the
generated docbook xml that should be further processed, and test.tex
that one processes to get the final pdf.

Any hints would be greatly appreciated.

Mojca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tex
Type: application/octet-stream
Size: 109 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220812/79c12c34/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.adoc
Type: application/octet-stream
Size: 1693 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220812/79c12c34/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.xml
Type: text/xml
Size: 2046 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220812/79c12c34/attachment.xml>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: m-asciidoc-manual.tex
Type: application/octet-stream
Size: 6848 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20220812/79c12c34/attachment-0002.obj>


More information about the ntg-context mailing list