Simplify and reorganize Lua filter introduction#9106
Conversation
| filters in Lua without any external dependencies at all. A Lua | ||
| ## Introduction | ||
|
|
||
| With Lua filters, you can write Pandoc filters without any |
There was a problem hiding this comment.
I think it would be worth saying what pandoc filters are, or at least linking to the other doc on pandoc filters.
Also there are two spaces before without in this line.
|
|
||
| With Lua filters, you can write Pandoc filters without any | ||
| external dependencies. Besides the simpler set-up, Lua filters are | ||
| generally faster and can access utility functions to manipulate |
There was a problem hiding this comment.
faster than what? Since the text mentioning JSON filters was removed, this is no longer clear.
| Command Time | ||
| --------------------------------------- ------- | ||
| `pandoc` 1.01s | ||
| `pandoc --filter ./smallcaps` 1.36s | ||
| `pandoc --filter ./smallcaps.py` 1.40s | ||
| `pandoc --lua-filter ./smallcaps.lua` 1.03s | ||
|
|
There was a problem hiding this comment.
It looks like this is indented 4 spaces and thus a code block instead of a table? What this change?
| Python (`smallcaps.py`): | ||
| manual (MANUAL.txt) to HTML, with versions of the same JSON filter | ||
| written in compiled Haskell (`smallcaps`) and interpreted Python | ||
| (`smallcaps.py`): |
| However, JSON filters have limitations: | ||
|
|
||
| - Writing JSON to stdout and reading it from stdin (twice, once | ||
| on each side of the filter) is inefficient. |
There was a problem hiding this comment.
this line should be indented so it lines up to the list content.
There was a problem hiding this comment.
also, I think the parenthetical comment could be removed
| - External dependencies vary between users, and universal JSON | ||
| filters are not possible. |
There was a problem hiding this comment.
I don't think it will be clear to readers what is meant by "universal JSON filters" or why dependency variation is important. I think the original text on this was clearer.
Something went wrong on my end in pull request #9120
Simplifies Lua filter introduction and comparison to JSON
Part of work on issue #8750
Co-authored-by: Matt Dodson <47385188+MattDodsonEnglish@users.noreply.github.com>