-
-
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
Allow defaults file to be specified in YAML header #7977
Comments
The proposal is already discussed in #5870. Conceptually, this doesn't make sense, I think, because one of the things the defaults file can specify is whether the input format is markdown and whether YAML headers are supported... There are also security implications. Of course, nothing prevents you from calling pandoc from a wrapper script that examines the front matter and calls pandoc with the appropriate defaults file -- as you have done yourself. |
I know, but #5870 is originally on another topic, so I thought it’d make sense to separate these. While obviously specifying whether to parse yaml headers after parsing them is bogus, I see it more like \documentclass in LaTeX, a way to say what type of document this is. Nonetheless, as you say, I’ll continue using my wrapper in Vim and other software supporting such things. And have unnecessary manual overhead in software that doesn’t… |
But note that LaTeX's |
But how is that different from being able to do |
I concur with @d12bb here. Also, adding to the previous comment, how is it different from |
To use defaults files for specifying templates etc., the only possible way currently is using the command line option. This poses problems for using from within editors (like Zettlr or as makeprg in Vim), as one has to add specific command line options (
-d foo
) for every file. If adefaults:
key in a file's YAML header was allowed (maybe only with--defaults-from-infile
or similar for security reasons), it could stand alone and customizing the Pandoc command line for every type of file would only still be necessary for edge cases.This was already discussed in this comment and following, but as #5870 is basically the opposite request and there is no response by @jgm on this topic, I'm opening a separate issue for what I consider to be a separate request.
Sample
or
Alternatives
There are tools like pandocomatic or panrun, which are much more powerful, but most times this power is not needed. Also, imo there should be no need for a third party tool for such a simple task.
For nVim, I created this pandoc.lua compiler plugin, which does exactly what I propose above, but only in Neovim:
The text was updated successfully, but these errors were encountered: