-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Create output filename based on input filename (and path) #3250
Comments
This feels like needless complexity to me. I think pandoc One can always create a wrapper, or even
Note also that there is not always an input filename, |
An even better approach is to use a Makefile with
Then you just need to type
|
On the other hand, some tools similar to pandoc does this, some examples are mmd and latexmk: multimarkdown file.md # equiv. to multimarkdown file.md > file.html
latexmk -pdf file.tex # output to file.pdf A syntatic sugar in pandoc can be helpful, something like pandoc -t pdf file.md
pandoc -t html -o "" file.md For The first example is output like pdf, docx, epub that probably is not for stdin. The second example has an empty string for |
And if the use of |
Note that the original moltivation in pandoc discuss is that it might be useful for other (especially new) users, because this ends up in something I need to do in my pandoc.sh or makefile like above. Note that a similar trick can be done by bash parameter expansion. So in the end it is just for a syntatic sugar that the end users might soon or later need to build themselves. However, I figure if the feature is not here for a decade, probably there's a reason for that. So if it seems to introduce too much complexity or can cause potential confusion, I think you should feel free to close it. |
This does not work because the shell would expand
This requires using a Makefile. When writing one-off documents, there isn't a need to create a Makefile or using some other build system.
I couldn't figure out what parameter expansion would work in this case. I tried The best shell workaround I could come up with is: pandoc -s -o foo.{docx,md} Though does not feel clean to me as I like to write in the order of input → output.
|
You may have missed this detail mentioned above, which makes it impossible to port
As for alternatives: how about |
And in those circumstances, pandoc could generate an error. There is already precedent for option dependencies, for instance the -o flag is mandatory when the -t flag is "odt" but not mandatory for some other file types such as md.
I actually tried |
One thing I like about pandoc's current behavior is that it won't overwrite files unless you explicitly specify them on the command line. With |
As discussed on pandoc-discuss, a method to map input filename to output filename would be nice. This
could be abbreviated as any of
and maybe also
The text was updated successfully, but these errors were encountered: