-
-
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
--metadata-file with non-markdown contents? #5914
Comments
Nope, we decided to start with markdown because currently the parsing of the YAML is quite intertwined with the markdown reader, but conceptually that was always just the first step. See #1960 (comment) |
It would be easy enough to add something like
|
Yes, I agree. I wouldn't be too concerned about 1), but there probably should be a way to override the format in case of 2). Or do we want to maintain a blacklist of formats (like docx) where we deem it doesn't make sense to use it for metadata formatting? |
We could assume markdown when the input format is docx or odt, and otherwise go with the input format (or HTML4 for epub 2, or HTML5 for epub 3). Another possibility (perhaps in addition to the above) would be to allow the default to be overridden with a field |
Of course this would mean we'd have to generalize the metadata reading code, which is currently pretty tightly bound up with the Markdown parser. I think this would be a good idea in any case (the code could be split out into a separate module and parameterized with a reader). |
For YAML metadata parsing. A step in the direction of #5914. No API change.
For YAML metadata parsing. A step in the direction of jgm#5914. No API change.
...so that, when the input format is not markdown or a markdown variant, pandoc's markdown is used. When the input format is a markdown variant, the same format is used. Reason for the change: it doesn't make sense to run the markdown parser with a set of extensions designed for a non-markdown format, and this dramatically limits what people can do in metadata files. Refines #6832. Closes #7926. Perhaps this can be reconsidered if we come up with a way of specifying an arbitrary format for the metadata file (#5914).
Currently string fields in
--metadata-file
are interpreted as pandoc markdown, no matter what input format is specified using--from
.But many JSON files found in the wild have other formats (esp. HTML), and it would be very handy to be able to use them with
--metadata-file
.Is there a compelling reason for using pandoc markdown no matter what the format of the main document? @mb21
The text was updated successfully, but these errors were encountered: