I’m often facing the need to add captions to tables. This results in me avoiding the table markdown syntax entirely, and writing pure HTML for doing so, which is extremely laborious when some of my tables have hundreds of rows.
I don’t know how one would choose a syntax for this, but pandoc checks for Table:
either before or after a table, and takes the text after Table:
as caption.
For instance:
Table: Colors
| Color | Hex |
| --- | --- |
| Blue | 0x0000FF |
| Red | 0xFF0000 |
| Yellow | 0xFFFF00 |
This would result in the following HTML:
<table>
<caption>Colors</caption>
<thead>
<tr>
<th>Color</td>
<th>Hex</th>
</tr>
</thead>
<tbody>
<tr>
<th>Blue</td>
<th>0x0000FF</th>
</tr>
<tr>
<th>Red</td>
<th>0xFF0000</th>
</tr>
<tr>
<th>Yellow</td>
<th>0xFFFF00</th>
</tr>
</tbody>
</table>
Can anyone implement such a plugin, or is it way too hard?