Skip to content

nihole1/md2docx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

md2docx

markdown -> docx word

Installation

  • 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

Files

  • 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

How to start

  • python3 render.py
  • yes
  • yes

render.py

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

About

Markdown to Word docx file conversion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%