Made it possible to pass multiple files to pandoc - fixes #248 by JessicaTegner · Pull Request #259 · JessicaTegner/pypandoc (original) (raw)
This pr makes it possible to pass multiple files to pandoc in various ways.
import pypandoc
convert all markdown files in a chapters/ subdirectory.
pypandoc.convert_file('chapters/*.md', 'docx', outputfile="somefile.docx")
convert all markdown files in the book1 and book2 directories.
pypandoc.convert_file(['book1/.md', 'book2/.md'], 'docx', outputfile="somefile.docx")
convert the front from another drive, and all markdown files in the chapter directory.
pypandoc.convert_file(['D:/book_front.md', 'book2/*.md'], 'docx', outputfile="somefile.docx")