Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asciidoctor attribute replacement in codeblock

In my current Asciidoctor document I have an atribute that I want to use in a codeblock. Is there a way to do String interpolation in a codeblock?

Attribute in header..

:api_version: 1.0

Codeblock

{
    "api_version" : "{api_version}",
}

I seem unable to do String replacement, any hints or tips to do String replacement in code block?

like image 878
Marco Avatar asked Sep 01 '25 22:09

Marco


1 Answers

You can apply substitutions like this:

.Example list of dependency RPMs:
[subs="verbatim,attributes"]
----
jdk-{java_version}-fcs.x86_64 <1>
jre-{java_version}-fcs.x86_64 <1>
sun-javadb-core-10.6.2-1.1.i386
sun-javadb-client-10.6.2-1.1.i386
sun-javadb-javadoc-10.6.2-1.1.i386
sun-javadb-demo-10.6.2-1.1.i386
sun-javadb-common-10.6.2-1.1.i386
sun-javadb-docs-10.6.2-1.1.i386
----
<1> Either the `jdk` or `jre` rpm must be installed.
like image 88
DavidGamba Avatar answered Sep 07 '25 03:09

DavidGamba