Since you mentioned you don't mind not using make
, you can try bash
.
I modified the code from this answer, use in the parent directory:
find ./ -iname "*.md" -type f -exec sh -c 'pandoc "${0}" -o "${0%.md}.pdf"' {} ;
It worked when I tested it, so it should work for you.
As per the request Any ideas how to specify the output folder? (Using html
as the original file and md
as the output):
find ./ -iname "*.html" -type f -exec sh -c 'pandoc "${0}" -o "./output/$(basename ${0%.html}.md)"' {} ;
I have tested this and it works for me.
Edit: As per a comment, the {} ;
when used with find
and the -exec
option is used as a, more or less, placeholder for where the filename should be. As in it expands the filenames found to be placed in the command. The ;
ends the -exec
. See here for more explanation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…