Skip to content

Instantly share code, notes, and snippets.

@rdmueller
Last active June 1, 2023 22:05
Show Gist options
  • Save rdmueller/b79f4b00890f75644a0186c4adda589a to your computer and use it in GitHub Desktop.
Save rdmueller/b79f4b00890f75644a0186c4adda589a to your computer and use it in GitHub Desktop.
This gist shows how to use AsciiDoc formatting inside a table

Sometimes you need to write AsciiDoc within a table, but the standard is that most AsciiDoc formattings don’t work inside a table, onyl the basic syntax:

Col1

Col2

Basic fomatting like bold works

advanced formatting like

* bullet * lists

do not work out of the box

The solution is to tell AsciiDoc that you need the AsciiDoc formatting. There are two ways to do this.

per cell

Just add the chracter a in front of the | pipe symbol for the cell and AsciiDoctor will render the cell as AsciiDoc

Col1

Col2

Basic fomatting like bold works

advanced formatting like

  • bullet

  • lists

now work

per column

You can also configure your columns. Put a [cols="a,a"] in front of your table and both columns will be rendered as AsciiDoc

Col1

Col2

Basic fomatting like bold works

advanced formatting like

  • bullet

  • lists

now work

even complex formattings like source code highlighting works this way

5.times {
    println it
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment