To convert a file from Markdown (.md) to a Word document (.docx), you can use several tools and methods. Here are some of the most popular options:
-
Install Pandoc:
- Windows: Download and install Pandoc from the official Pandoc website.
- macOS: Use Homebrew:
brew install pandoc - Linux: Use your package manager, e.g.,
sudo apt-get install pandocon Debian-based systems.
-
Convert the file: Open your terminal or command prompt and run the following command:
pandoc input.md -o output.docx
Replace
input.mdwith the path to your Markdown file andoutput.docxwith the desired path for your Word document.
There are various online tools available that can convert .md files to .docx without requiring any software installation.
- Convertio:
- Visit Convertio's Markdown to DOCX converter.
- Upload your
.mdfile. - Click "Convert".
- Download the converted
.docxfile.
Some Markdown editors have built-in export functionality to convert Markdown files to Word documents.
- Typora (a popular Markdown editor):
- Open your
.mdfile in Typora. - Go to
File>Export>Word (.docx). - Save the file.
- Open your
Microsoft Word itself can open Markdown files and save them as .docx.
- Open Microsoft Word.
- Go to
File>Openand select your.mdfile. - Once the file is open, go to
File>Save Asand choose the.docxformat.
If the lists are unordered:
You can use pandoc -t native to see how pandoc is parsing this.
You'll see that the list is not parsed as a list. Why not?
Well, pandoc's markdown requires a blank line before a list, to avoid false positives on lists (e.g. when a number followed by a period gets wrapped to the beginning of a line -- there was actually a test case like this in the original Markdown.pl test suite).
This requirement used to be common (following original Markdown.pl), but now that commonmark has allowed omitting the space, it is less common. See babelmark.
Anyway, the solution for you is to use -f commonmark or -f gfm or -f commonmark_x instead of the default -f markdown.
Example:
pandoc -f commonmark FR_dossier_competence.md -o FR_dossier_competence.docx