Hi Albert!
So here is the complete example:
$ cat callout.adoc
[source,yaml]
----
bmc:
address: <bmc_address>
credentialsName: <secret_credentials_name> <1>
disableCertificateVerification: True
----
<1> `credentialsName` needs a callout
$ cat callout.xml
<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>Untitled</title>
<date>2022-11-25</date>
</info>
<programlisting language="yaml" linenumbering="unnumbered">bmc:
address: <bmc_address>
credentialsName: <secret_credentials_name> <co xml:id="CO1-1"/>
disableCertificateVerification: True</programlisting>
<calloutlist>
<callout arearefs="CO1-1">
<para><literal>credentialsName</literal> needs a callout</para>
</callout>
</calloutlist>
</article>
$ pandoc -t markdown -f docbook callout.xml
``` yaml
bmc:
address: <bmc_address>
credentialsName: <secret_credentials_name>
disableCertificateVerification: True
```
- `credentialsName` needs a callout
I'm just not clear whether this can be handled with a lua filter or not.
Aidan Reilly <aire...@redhat.com> writes:
> A feature of docbook/asciidoc that is really useful is codeblock
> callouts. It seems that this is not currently supported in the latest
> pandoc.
I didn't know about callouts, they seem like a nice and useful feature:
https://docs.asciidoctor.org/asciidoc/latest/verbatim/callouts/
Could you post the DocBook code generated by asciidoctor? I suspect that
this feature would require changes to the docbook reader, but maybe once
could make do with a custom Lua reader.
> Is there a way to tell pandoc to passthrough codeblocks "untouched"?
> I think if this was the case a lua filter could apply the rest of the
> markup I need.
>
> Example:
> $ cat callout.adoc
> [source,yaml]
> ----
> bmc:
> address: <bmc_address>
> credentialsName: <secret_credentials_name> <1>
> disableCertificateVerification: True
> ----
> <1> `credentialsName` needs a callout>
>
> Run through asciidoctor > pandoc:
>
> $ asciidoctor -b docbook -o - callout.adoc | pandoc -t markdown -f
> docbook
> ``` yaml
> bmc:
> address: <bmc_address>
> credentialsName: <secret_credentials_name>
> disableCertificateVerification: True
> ```
>
> - `credentialsName` needs a callout
>
> Any other suggestions or strategies welcome
--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124