markdown -> docx word
- clone this project into your local folder
- install Python3 with YAML and pywin32 packages (win32com.client)
- install Pandoc
- install any MarkDown editor. I use Typora. Any simple text editor can be used, but this is not very convenient
- render.py - Python script. Takes data from the markdown file, converts and inserts it into a Word document
- structure.yml - YAML file with all the necessary parameters for render.py
- template.docx is a Word document that we are going to fill out with the context of markdown documents. This Word document should have all the styles, templates ... you are going to use. This document is divided manually into sections. Each section corresponds to one chapter
- example_chapter.md - markdown document with example information
- initial folder - initial files
- python3 render.py
- yes
- yes
From structure.yml you can see how this script works.
actions:
structure_verification: "yes"
change_data: "yes"
table_style: "yes"
table_caption: "yes"
figure_caption: "yes"
update_fields: "yes"
- structure_verification - verifies if the section corresponds the title
- change_data - inserts data in this section
- table_style - changes the table style
- table_caption - transforms markdown caption to the word caption for tables
- figure_caption - transforms markdown caption to the word caption for figures
- update_fields - updates all fields