Asciidoctor: how to layout two code blocks side by side?

Viewed 74

Is it possible to have two code blocks side-by-side using Asciidoctor? I could not find any examples in the documentation or on SO.

1 Answers

Yes:

= Side by side

Enjoy these code samples:

[cols="a,a", options="header"]
|===
| JavaScript
| Perl

|
[source, javascript]
----
console.log('Hello World!')
----

|
[source, perl]
----
#!/usr/bin/env perl

print "Hello World!\n"
----
|===

Produces:

enter image description here

Related