Skip to content
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

Simplify and reorganize Lua filter introduction #9106

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IlonaSilverwood
Copy link
Contributor

Something went wrong on my end in pull request #9120

Simplifies Lua filter introduction and comparison to JSON

  • Removes text previously mentioned in filter parent topic
  • Simplifies text for easier skimming

Part of work on issue #8750

Co-authored-by: Matt Dodson <[email protected]>

filters in Lua without any external dependencies at all. A Lua
## Introduction

With Lua filters, you can write Pandoc filters without any
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faster than what? Since the text mentioning JSON filters was removed, this is no longer clear.

Comment on lines +69 to 75
Command Time
--------------------------------------- -------
`pandoc` 1.01s
`pandoc --filter ./smallcaps` 1.36s
`pandoc --filter ./smallcaps.py` 1.40s
`pandoc --lua-filter ./smallcaps.lua` 1.03s

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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`):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space at end of line

However, JSON filters have limitations:

- Writing JSON to stdout and reading it from stdin (twice, once
on each side of the filter) is inefficient.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line should be indented so it lines up to the list content.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, I think the parenthetical comment could be removed

Comment on lines +61 to +62
- External dependencies vary between users, and universal JSON
filters are not possible.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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