Batch processing Pandoc conversions in Windows

后端 未结 5 851
遥遥无期
遥遥无期 2020-12-10 08:11

I am trying to convert a large number of HTML files into Markdown using Pandoc in Windows, and have found an answer on how to do this on a Mac, but receive errors when attem

5条回答
  •  离开以前
    2020-12-10 08:54

    If you want to go recursively through a directory and its subdirectories to compile all the files of type, say, *.md, then you can use the batch file I wrote in answer to another question How can I use pandoc for all files in the folder in Windows? . I call it pancompile.bat and the usage is below. Go to the other answer for the code.

    Usage: pancompile DIRECTORY FILENAME [filemask] ["options"]
    Uses pandoc to compile all documents in specified directory and subdirectories to a single output document
    
    DIRECTORY         the directory/folder to parse recursively (passed to pandoc -s);
                      use quotation marks if there are spaces in the directory name
    FILENAME          the output file (passed to pandoc -o); use quotation marks if spaces
    filemask          an optional file mask/filter, e.g. *.md; leave blank for all files
    "options"         optional list of pandoc commands (must be in quotation marks)
    
    Minimal example: pancompile docs complete_book.docx
    Typical example: pancompile "My Documents" "Complete Book.docx" *.md "-f markdown -t docx --standalone --toc"
    

提交回复
热议问题