md2indexhtml
is a Python package that converts Markdown files to HTML files as index.html.
- Converts Markdown to HTML
- Supports custom templates and CSS
- Automatically generates a sidebar from headers
- Easy-to-use command line interface
Install the package using pip:
pip install md2indexhtml
This document provides instructions on how to use the md2indexhtml
package to convert Markdown files to HTML files.
To convert a Markdown file to an HTML file using the default settings, run the following command:
md2indexhtml path/to/yourfile.md
You can customize the conversion by providing additional options:
output_dir
: Directory to save the output HTML file.template
: Path to the HTML template.css
: Path to a custom CSS file.title
: Title for the HTML document and navbar.
Example:
md2indexhtml path/to/yourfile.md path/to/output/dir --template path/to/template.html --css path/to/custom.css --title "My Documentation"
md2indexhtml README.md output --title "Default Theme"
md2indexhtml README.md output --title "GoDocs Theme" --template godocs.html
md2indexhtml README.md output --title "DocBox Theme" --template docbox.html
You can also use the package programmatically in your Python code:
from md2indexhtml import convert_md_to_html
convert_md_to_html(
md_file_path="path/to/yourfile.md",
output_dir="path/to/output/dir",
template_path="path/to/template.html",
custom_css_path="path/to/custom.css",
title="My Documentation"
)
Contributions are welcome! Please feel free to submit a pull request or open an issue on GitHub.
This project is licensed under the MIT License.
Feel free to adjust any of the content to better suit your needs.