-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Lua filters: allow using SimpleTable instead of Table #6575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
A new block type This is a draft, as I couldn't fully convince myself that this is the best way forward. It requires some unfortunate special-casing, but otherwise seems to work quite well. |
A simpler approach might be not to add SimpleTable as a faux block element, but instead add a function that treats the element as a simple table. That is: function Table(el)
local el2 = to_simple_table(el)
-- do stuff with el2
return from_simple_table(el)
end or maybe this could be encapsulated in one function with_simple_table(el, function(el2) ... end) |
If I understand correctly, then this would make SimpleTable a standalone type which does not inherit from type Block. We'd be moving the unmarshaling code for SimpleTable into a separate function, which is then exposed to Lua. That does seem cleaner. |
36e0edf
to
11df774
Compare
I'm sorry, I sort of lost track of this. Do you want to rebase so we can see if the tests pass? |
0028c0f
to
b039379
Compare
Rebased, squashed, and updated the commit message. |
Cabal-based tests fail because
Stack-based tests succeed. |
What's the problem with text-conversions? |
I've pushed a commit that uses the dev version of pandoc-citeproc. |
Thanks!
IIUC, then there has been a new release of base16-bytestring which breaks text-conversions, as that package does not set an upper bound for base16-bytestring. Relevant discussion.
It is a dependency of doctemplates. It seems that we also use it in function |
A new type `SimpleTable` is made available to Lua filters. It is similar to the `Table` type in pandoc versions before 2.10; conversion functions from and to the new Table type are provided. Old filters using tables now require minimal changes and can use, e.g., if PANDOC_VERSION > {2,10,1} then pandoc.Table = pandoc.SimpleTable end and function Table (tbl) tbl = pandoc.utils.to_simple_table(tbl) … return pandoc.utils.from_simple_table(tbl) end to work with the current pandoc version.
b039379
to
04d66c5
Compare
Old filters using tables now require minimal changes and can use
and
to work with the current pandoc version.