Skip to content

Conversation

@cscheid
Copy link
Collaborator

@cscheid cscheid commented Jul 14, 2023

Context: a Lua filter from an extension doesn't have a file extension. We call it like this:

filters:
  - some_filter_extension

This makes sense because the user doesn't know the internal name of the Lua file in the filter. However, this notation is ambiguous. If the extension doesn't exist (or, as commonly happens, is misspelled), we interpret the filter as a JSON filter. In this case, our current error message is not very helpful.

This PR improves the situation.

Example:

FATAL (/Users/cscheid/repos/github/quarto-dev/quarto-cli/src/resources/filters/./common/wrapped-filter.lua:128) An error occurred:
Could not run /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid as a JSON filter.
Please make sure the file exists and is executable.

Did you intend 'shinygrid' as a Lua filter in an extension?
If so, make sure you've spelled the name of the extension correctly.

The original Pandoc error follows below.
Error running filter /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid:
Could not find executable /Users/cscheid/repos/github/wch/shinycomponent/quarto/shinygrid

@cscheid cscheid merged commit 13c11b1 into main Jul 14, 2023
@cscheid cscheid deleted the enhancement/json-filter-error-message branch July 14, 2023 15:15
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.

2 participants