jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.38k stars 3.37k forks source link

Can't set metadata when exclusively using textile #5051

Closed iirelu closed 5 years ago

iirelu commented 5 years ago

For some reason, pandoc is incapable of detecting a metadata.yaml (even when explicitly set via -H) when the only input format being used is textile. Adding an empty markdown file to the beginning of the file list fixes this. Without the empty markdown file, the contents of metadata.yaml are included as if formatted by the textile converter.

screenshot from 2018-11-07 09-13-21

My version of pandoc is 2.3.1.

mb21 commented 5 years ago

Can you post exact commands please?

And post text, not screenshots.

tarleb commented 5 years ago

Don't think this is a bug. I seems like you intended to use the --metadata-file. Files passed via the -H option are not parsed and included verbatim.

iirelu commented 5 years ago

test.textile:

"hello!"

metadata.yaml:

---
title: "blah"
---

Command: pandoc pandoc -o out.html test.textile metadata.yaml

Output:

<p>“hello!”</p>
<hr />
<p>title: “blah”<br />
—-</p>

I did indeed think -H was an alias of --metadata-file. I think I got that from an inaccurate stackoverflow post. However, if you change .textile to .md, it works as expected, and most places say you can just throw a metadata.yaml on the end instead of using --metadata-file, so I still think this is a bug.

mb21 commented 5 years ago

I did indeed think -H was an alias of --metadata-file.

Nope, see http://pandoc.org/MANUAL.html

and most places say you can just throw a metadata.yaml on the end

That actually only works for markdown files.

Feel free to correct the inaccurate stackoverflow post...