Any one knows how to pass variables {var}
into [source]
blocks and example blocks (with ====
) in Asciidoc?
I have tried the following
:country: France
:city: Shanghai
[source]
----
print("{country} is a country")
print("{city} is a city")
----
.Example
====
{country} is a country +
{city} is a city
====
.Example with better alignment
====
{country} is a country
{city} is a city
====
But this is what I get:
Actually the first "example" is working but it is not the ideal solution because:
- It does not have the grey area like other examples
- I need to add a
+
at the end of each line
Looking forward your inputs. Thanks in advance!
[source, subs="attributes"]
... but the question remains for the "Example with better alignment" that uses====
: any idea? – Impenetrable