Skip to content

Conversation

@SeanESCA
Copy link
Contributor

@SeanESCA SeanESCA commented Jul 8, 2025

This PR adds a code example of how to use the pandoc.Table constructor in a Lua filter and a few notes on the colspec and bodies parameters. These changes were made under the pandoc.Table constructor section of the documentation. I think that this will help provide enough information for someone to use this constructor without prior knowledge. This may be relevant to #6569 and #6571.

@rnwst
Copy link
Contributor

rnwst commented Jul 8, 2025

I think this part of the documentation is auto-generated (see comment at line 2501). @tarleb will know where to make this change.

@tarleb
Copy link
Collaborator

tarleb commented Jul 8, 2025

Thanks for this, those are good improvements. The function is defined here and the docs are then generated from that. https://github.com/pandoc/pandoc-lua-marshal/blob/22c865629b67a78291b3c6eb568ecc79eca1e0ad/src/Text/Pandoc/Lua/Marshal/Block.hs#L463

We should probably add a TableBody constructor.

@SeanESCA
Copy link
Contributor Author

SeanESCA commented Jul 8, 2025

Since the Examples section in lua-filters.md is not auto-generated (right?), I could move my changes as they are to that section. If that works, I could also try to rewrite the link info table example from #6571 and include it back in.

@tarleb
Copy link
Collaborator

tarleb commented Jul 9, 2025

That's a good idea. 👍

@SeanESCA
Copy link
Contributor Author

I've changed my original example into a filter, and tested both examples on some of my documents and they seem to be working. If the TableBody constructor is a good first issue, I could try taking it on.

@tarleb
Copy link
Collaborator

tarleb commented Jul 10, 2025

Great, thank you! Excellent additionsj! The only suggestion I have is to make it a bit clearer that the argument to Pandoc in the second example is discarded, so maybe function Pandoc (_)?

A PR to add TableBody would be most welcome. Most work would probably happen in the Text.Pandoc.Lua.Marshal.TableParts module, or in a new module based on that one. It's a bit DSL-heavy, so if you run into issues, please let me know, and I'll try my best to help.

@tarleb tarleb merged commit 2b31cb4 into jgm:main Jul 10, 2025
1 of 4 checks passed
@tarleb
Copy link
Collaborator

tarleb commented Jul 10, 2025

Thanks!

@SeanESCA
Copy link
Contributor Author

Thanks for the help @tarleb !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants