This Python script automatically generates Marp-formatted documents by parsing Markdown files within a specified root directory. The script is highly configurable, allowing you to specify the sections and levels to be included in the final document as well as the locale for the root directory.
- Python 3.x
argparse
library (built-in with Python)re
library (built-in with Python)os
library (built-in with Python)yaml
library (can be installed via pip)
- Clone the repository to your local machine.
- Navigate to the directory where the script resides.
- Make sure you have all the required libraries installed.
To run the script, navigate to its directory and run:
python generate-marp-slide.py
You can customize the script's behavior through the following command-line arguments:
-
--sections
: Specifies which sections to include in the final document.Example:
python scripts/generate-marp-slides.py --sections top description
This will include only the 'top' and 'description' sections in the final document.
Current options are top, description, example, exercise and checklist
-
--levels
: Specifies which levels to include in the final document.Example:
python scripts/generate-marp-slides.py --levels lv0 lv1
This will include content of levels 'lv0' and 'lv1' in the final document.
Current options are lv0, lv1, lv2 and lv3
-
--locale
: Specifies the locale to set the root directory.Example:
python scripts/generate-marp-slides.py --locale ja
This will set the root directory to
'contents/ja'
.
You can combine multiple options as follows:
python scripts/generate-marp-slides.py --sections top description example exercise checklist --levels lv1 lv2 lv3 --locale en
Feel free to fork the repository and submit pull requests.