-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Expand ${HOME}, ${USERDATA} and ${.} In all strings in defaults files #10252
Comments
This is probably a good idea. I limited it to paths because, who knows, one might want to include a code block with @tarleb thoughts? |
Would it make sense to limit the expansion to the start of metadata values? Expanding all values everywhere seems a bit much. |
The code for defaults file parsing is incredibly complicated and it will be hard to make a change like this without simplifying it first. |
I think it is even reasonable to limit it to the start of strings without any newlines in them. |
Proposed enhancement and the problem it solves
My request is to make the “variables”
${USERDATA}
${HOME}
${.}
expand to their respective paths in any string in a defaults file, so that you for example can have
in a defaults file and have it appear expanded in
PANDOC_WRITER_OPTIONS.variables.my_filter_data
in Lua filters.Currently I do fake this with the code below, but (a) it feels fragile, (b) it is a lot of boilerplate and (c) it does not work for
${.}
anyway.1I wouldn’t mind if the code needed in every filter reading in files were reduced to the last block, mutatis mutandis.
Related
#10251
Footnotes
And the boilerplate includes the not shown
read_json_file
function, but that is another issue! ↩The text was updated successfully, but these errors were encountered: