Converts Markdown Ninja templates into beautiful websites you can host staticly!
The goal of this project is to develop a Python script that automates the process of converting a folder of Markdown files to HTML and processing them as Ninja templates. The script should also be able to serve the processed files in a browser for testing purposes.
- Convert Markdown files to HTML files.
- Process HTML files as Ninja templates, excluding files with a
.tpl.html
extension. - Copy the
assets
folder from the source folder to the output folder. - Serve the output folder in a browser for testing purposes.
- Allow user to define input and output folder names and locations.
- Provide a command-line interface to build or serve the project.
markdown_ninja.py
: A Python script that implements the features mentioned above.README.md
: A brief documentation file that explains how to use the script and its features.- Sample folders: A sample input folder (
public_md
) and the resulting output folder (public_html
) to demonstrate the script's functionality.
To build the project, run the following command:
python3 markdown_ninja.py build -t /path/to/target-dir -m public_md -o public_html
To serve the output folder, run the following command:
python3 markdown_ninja.py serve -t /path/to/target-dir -o public_html -p 8000
The script will serve the public_html
folder at http://localhost:8000
by default. The port number can be changed using the -p
option.
- Python 3.6 or later
- Markdown:
pip install markdown
- Jinja2:
pip install Jinja2
- Improve error handling and add user-friendly messages for various exceptions.
- Add support for additional template engines.
- Implement a watch mode that rebuilds the project automatically when source files are modified.
- Add support for custom build configurations through a configuration file.