/pandoc-table-attr

Pandoc filter to allow specifying of table attributes in table captions.

Primary LanguagePythonBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

pandoc-table-attr

A pandoc filter that adds the capability of specifying table attributes in table captions in Pandoc's Markdown.

How to use

Simply append attributes to table captions like so:

Table: Table caption. {#id .class key=val}

FirstCol   SecondCol
---------  ----------
FirstCell  SecondCell

The attributes specified in the table caption will then be added to pandoc's AST and used by pandoc's writers (the HTML writer utilises table attributes, but the author hasn't tested this with any of the other writers yet).

Table attributes must appear at the end of the table caption.

Known limitations

The current implementation of pandoc-table-attr does not allow inline elements to be used in keyvalues if they would be parsed by pandoc as inline formatting, inline math, inline code blocks (Extension: backtick_code_blocks), generic raw attributes, inline links, or citations. Therefore, the following will not work:

Table: Table caption. {#id .class key="*val*"}

Pandoc will parse *val* as emphasized text, instead of literal asterisks. However, it is possible to use backslash escapes as a workaround:

Table: Table caption. {#id .class key="\*val\*"}

The author hopes to remove this limitation soon.