-
-
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
Lua support for resolving files in the data directory #9854
Comments
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: jgm#9854
I've opened #9855. |
Awesome. Do you think item 2 above is worthwhile? |
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: jgm#9854 Co-authored-by: Carsten Gips <cagix@hsbi.de>
I think a There's also the generally conservative approach with respect to new Lua functions, as each new functions adds more code to maintain (and compile, and ship), so it's important to only add the "right" functions. BTW, that's also the reason why I open PRs for these functions instead of just pushing a commit to master, because I want to make sure that "we get it right" with these API changes. |
So what I'm trying to say is that I wouldn't rule out The |
That all makes perfect sense. I had some of the same thoughts, which is why I asked. |
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: jgm#9854 Co-authored-by: Carsten Gips <cagix@hsbi.de>
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: jgm#9854 Co-authored-by: Carsten Gips <cagix@hsbi.de>
The function allows to specify a template with the same argument value that would be used with the `--template` command line parameter. Closes: #9854 Co-authored-by: Carsten Gips <cagix@hsbi.de>
Add Lua support for resolving and reading files from the data directory. At minimum, this should support loading named templates. Ideally, this would enable API access to any type of file stored in the data directory.
From discussion #9853:
Thoughts:
Add new function
get(template_name)
to modulepandoc.template
, which locates the named template in the "templates" directory, and reads and returns its text content, similarly to existing functionpandoc.template.default
.Add new function
data_file(name)
to modulepandoc.utils
(or elsewhere), which resolves a relative path in the data directory and returns an absolute file path if the file exists, or nil if does not. This would provide a standard mechanism to allow any data directory file to be read, added to the media bag, etc.The text was updated successfully, but these errors were encountered: