MD2HTML is a powerful and user-friendly tool for converting Markdown files to HTML in batch mode. This tool supports syntax highlighting, custom CSS styling, and generates an index page for easy navigation. The project is ideal for creating personal blogs, documentation sites, or any other static web content from Markdown files.
- Batch Conversion: Converts multiple Markdown files to HTML in one go.
- Custom CSS Styling: Supports light and dark mode themes.
- Syntax Highlighting: Uses Pygments for beautiful code highlighting.
- Copy Button for Code Blocks: Adds a copy button to code blocks for easy copying.
- MathJax Support: Automatically includes MathJax for rendering mathematical notations.
- Index Page Generation: Creates an index page listing all converted HTML files.
- Folder Structure Option: Option to organize HTML files into folders for clean URLs.
-
Clone the repository:
git clone https://github.com/ZigaoWang/md2html-batch.git cd md2html-batch
-
Install the required dependencies:
pip install -r requirements.txt
-
Place your Markdown files in the
input
folder. -
Run the script:
python main.py
-
Follow the prompts to choose your preferences:
- Mode: Choose between light and dark mode for CSS styling.
- Site Name: Enter a name for your site, which will appear as the title of the index page.
- Use Folders: Decide whether to use folders for clean URLs.
-
The converted HTML files will be generated in the
output
folder, with anindex.html
file for navigation.
- CSS Styles: Modify
style_light.css
andstyle_dark.css
to customize the appearance of your HTML files.
Here's an example of how to convert Markdown files:
- Place your
.md
files in theinput
folder. - Run
python main.py
. - Enter your preferences when prompted.
- The HTML files will be generated in the
output
folder.
This project is licensed under the MIT License. See the LICENSE file for details.
Made with 💜 by Zigao Wang.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
For any questions or suggestions, please open an issue or contact Zigao Wang.