Replies: 1 comment
-
|
Maybe the error message could be: "Pandoc does not have a default data file named foobar.baz" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Explain the problem
Sorry if this discussion probably looks like a misunderstanding on my part and kind of unnessary, and still may include incorrect information — I spent some time reading the docs and experimenting, and I think I now get how it's supposed to work. But I initially found the behavior kind of confusing, so I wanted to share my experience in case it helps improve the docs or UX.
After reading the docs, I now understand the intent:
--print-default-data-filelooks up pandoc data files by name (inside pandoc's data dir / data path), not arbitrary relative/absolute filesystem paths.So it's more like a suggestion / UX-doc improvement discussion, because the current failure mode is very easy to misinterpret at first:
--print-default-data-file <something.docx>and reasonably assumes<something.docx>can be a path to an existing.docx(e.g. a custom reference docx in the current directory).Could not find data file <something.docx>(exit 97), which doesn’t explicitly say “I only searched the pandoc data directory”.--data-dir/ the data directory concept, it’s not obvious what to do next.If this is considered “working as designed”, I’m fine with closing as “documentation/clarification”; otherwise it could be treated as an upstream usability fix.
Concrete improvement ideas
Any of the following would have prevented my confusion:
pandoc --data-dir)”.--print-default-data-filesaying it only accepts names of pandoc data files, not filesystem paths.Exact commands and output (repro)
Even if the file exists in the current directory, pandoc still reports “data file not found”, which is the core of the UX confusion:
Output:
Exit code:
97I originally hit this while trying variants like:
Output:
Exit code:
97Same result with:
Adding
--verbosedoesn’t add more context:What I expected
Either:
--print-default-data-fileaccepts a filesystem path and prints the file, orpandoc --data-dir).Pandoc version?
pandoc --version:Workaround / discovered correct usage (what I learned)
To export the bundled reference docx, this works:
or
as mentioned in the docs.
To see where pandoc's data files live, use:
Beta Was this translation helpful? Give feedback.
All reactions