tomduck / pandoc-tablenos

A pandoc filter for numbering tables and table references.
GNU General Public License v3.0
108 stars 8 forks source link

Support Para-typed captions #25

Open timtroendle opened 3 years ago

timtroendle commented 3 years ago

Pantable changed its caption type from Plain to Para. Because tablenos expects the caption type to be Plain, tablenos 2.3.0 does not work with pantable >= 0.13.0.

I don't know why the type has changed or whether that it compatible with the pandoc AST. As long as it is compatible, it would be great if tablenos could handle both types.

toshiakiasakura commented 2 years ago

Same error when try to insert tag for tablenon

---
include: Table1.csv 
caption : A nice caption {#tbl:1}
markdown: true
table-width: 5/5
alignment: LLLLL
---

Then the following error occurs

  File "/home/toshiaki/.local/bin/pandoc-tablenos", line 8, in <module>
    sys.exit(main())
  File "/home/toshiaki/.local/lib/python3.8/site-packages/pandoc_tablenos.py", line 684, in main
    altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
  File "/home/toshiaki/.local/lib/python3.8/site-packages/pandoc_tablenos.py", line 684, in <lambda>
    altered = functools.reduce(lambda x, action: walk(x, action, fmt, meta),
  File "/home/toshiaki/.local/lib/python3.8/site-packages/pandocfilters.py", line 128, in walk
    res = action(item['t'],
  File "/home/toshiaki/.local/lib/python3.8/site-packages/pandoc_tablenos.py", line 124, in attach_attrs_table
    assert value[1][1][0]['t'] == 'Plain'
AssertionError
Error running filter pandoc-tablenos:
Filter returned error status 1

Want to do like pandoc-crossref : https://github.com/ickc/pantable/discussions/46