-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add builtin standards for Pandoc filter globals #115
base: master
Are you sure you want to change the base?
Conversation
@tarleb If you get a chance I'd be happy for feedback on this. I started in an it and ran into several things I didn't expect even after plenty of my own use to pull from. For starters, does it make any sense to split up filters, readers, and writers as far as what globals they are allowed to read and/or write? I realize there will be a lot of overlap (which is fine) but is there any meaningful distinction at all? Also, is there any difference between filters that just set global functions vs, ones that return a table with filter functions? Obviously in many cases they are currently interchangeable, but my take is the latter is a little more robust. Is the former being deprecated in favor of the latter? |
25021e0
to
716cbeb
Compare
…ders, and writers
Cool! I think the distinction between reader and writer could be dropped, pandoc just has a single custom category. In fact, having both a reader and a writer in the same file is perfectly fine. I'm not really familiar with luacheck and will have to do some reading before I can give more qualified comments. |
Thanks, that makes sense. How is the custom category scoped? Is it meaningfully different from the filter category? Are those two categories meaningful groupings or would it be possible to have a filter and a reader (or writer) in the same file? Are reader/writer strictly a superset of filter? Would it make sense to throw an error in a filter if one tried to define something unique to reader/writers? |
Some differences: the It might make sense to also distinguish |
Per that comment I've refactored this into Note that all of these are expected to be used as additions to |
I ask about all those preset arrangements because I'm hopping to get this in a release soon, and any changes to the preset names will be a breaking change if we ever wanted to do so. Adding Pandoc support won't be a breaking change and expanding support for detailed lints (e.g. noting all the specific fields in the |
The last release with Lua 5.3 was pandoc 2.19. The version shipped with Debian bookworm is 2.17, and some Ubuntu LTS versions also have pandoc versions that use Lua 5.3. Based on that, I'd say that it makes sense to specify the Lua version. I think the last pandoc version that could, theoretically, have been built against luajit was 2.3.2, so it's really only 5.3 and 5.4 at this point. |
Thanks, I'll leave it as an add-on set and expect the user to specify |
This is the bare minimum to get started. The complete API is pretty well document and we could probably detail all the modules and fields/functions, but one has to start somewhere and I don't have infinite time. Contributions welcome!