Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Converting several Markdown files into DOCX using pandoc

MKaer

New Coder
I have a folder called Project:

Project:

img
docs
README

The README is written in Markdown and looks like this:

document 1
document 1.1​
document 2
document 2.1​
document 2.1.1​

The readme has links to the individual Markdown files. The file structure in the document folder looks like this:

Document 1
Document 2
document 11
Document 21
Document 211

The documents have images that come from the img folder and have cross references to each other e.g. Document 1 has a reference to Document 11.

How can I use a pandoc command to convert the documents as they appear in order in the README to a DOCX file, with the corresponding images and the cross references in the respective Markdown files. Is there a suitable script with pandoc for this?

I had it once with the pandoc command:

for /r "." %i in (*.md) do pandoc -o "%~i.docx" "%~i"

All files in the docs folder were converted to a DOCX file and merged, but the order was completely wrong and the cross references were to the Markdown files from the docs folder and not from the created DOCX file.
 
Back
Top Bottom