Closed dmitryperets closed 9 months ago
That should be doable. From a quick glance, the only changes needed are in the HandleTable
function.
I tried something in 9015d5203cd6f497d560e73b3e64414a5fc2d49d. Could you check if that works for you?
@tstenner unfortunately, it still fails. The problem is actually here, I think: https://github.com/tstenner/luarefnos/blob/9015d5203cd6f497d560e73b3e64414a5fc2d49d/refnos.lua#L71
Specifically, the Cap[namespace]
- it doesn't have tbl
there.
In my tests I added it in the front matter of the sample document:
---
title: Pandoc-fignos Demo
lang: de
luarefnos:
strs:
de:
tbl: {ref: 'Tableu', plural: 'Tableus'}
...
In the markdown names, I find tbl:
to be slightly better to read, but the abbreviation in the text is Tab.
in both cases, so I'm not entirely convinced the duplicated mapping for the tbl
it should be included by default.
Oh I see, you specify the mapping in the metavars... This sounds ok, I guess!
The whole idea to support tbl:
is because "pandoc-xnos" is using this notation, so anyone having a large document written for pandoc-xnos would need to rename all their tables. But if it is only to add a metavar, then it's fine!
Helpful, thanks! I've given up on Pandoc-crossref
and fully embraced luarefnos!
Since pandoc-xnos seems to be dead for now and it doesn't really support pandoc 3.x (e.g.
pandoc-fignos
is broken due to the new AST format), migrating to this native LUA implementation sounds like a good idea. But it would be beneficial if we could keep the documents written for pandoc-xnos...So one of the differences is the fact that tables in
pandoc-xnos
are abbreviates withtbl:
, whileluarefnos
usestab:
by default. I fixed it for myself, by adding a duplicate line fortbl
here:https://github.com/tstenner/luarefnos/blob/4ae8fbca1d72c76481c975ab83649764c9557abb/refnos.lua#L367-L381
E.g.:
With this change, I can render the documents that have links like
@tbl:silly
Apparently, I couldn't just replace "tab" with "tbl", because is some other places it is used...I suggest adding "official" support for this.