Japanese/ English
A sample script which converts Markdown (*.md) to Office Open XML Document (*.docx). It only supports headers, bullet items, and numeric items up to 3rd depth.
Please find the explanation of how it works written in Japanese here.
USE THIS SCRIPT AT YOUR OWN RISK.
md2docx.rb
Convert scriptsample.md
Sample markdown filetemplate.docx
Template file
Following items up to 3rd depth.
- header
- bullet item
- numeric item
# header1
## header2
### header3
* bullet item 1
* bullet item 2
* bullet item 3
1. numeric item 1
1. numeric item 2
1. numeric item 3
$ ruby md2docx.rb
Usage: md2docx [options] file
-t, --template [template file]
-o, --output [output file]
Here is the sample input file.
# md2docx sample file
## Paragraph
This is a paragraph.
## list
### Numeric item
1. hoge1
1. hoge2.1
1. hoge2.2
1. fuga1
1. fuga2.1
1. fuga2.2
### Bullet items
* bullet1
* bullet2
* bullet3
* bullet1
* bullet2
* bullet3
### Mixed
* bullet1
1. enum1
* bullet3
1. enum2
You can convert the above via following command.
$ ruby md2docx.rb sample.md
Using template.docx
Reading sample.md
Generating sample.docx
Done.
If you run the above, you will have the following sample.docx
.
It contains Japanese Katakana since the template file contains it.