This repository contains a Python script that converts Markdown files into HTML with advanced features, supporting a wide range of Markdown elements and extensions.
- Heading
- Bold
- Italic
- Blockquote
- Ordered List
- Unordered List
- Code
- Horizontal Rule
- Link
- Image
- Table
- Code Block
- Footnote
- Definition List
- Strikethrough
- Task List
- Emoji
- Highlight
- Subscript
- Superscript
- Python 3.7 or higher
- Dependencies:
beautifulsoup4
emoji
Install the dependencies using:
pip install beautifulsoup4 emoji
- Place your Markdown file in the project directory (e.g.,
example.md
). - Run the script with the following command:
python Markdown.py
- The converted HTML file (e.g.,
example.html
) will be generated in the same directory.
# Welcome
This is **bold** text and *italic* text.
- Item 1
- Item 2
[Visit Google](https://google.com)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Markdown to HTML</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is <strong>bold</strong> text and <em>italic</em> text.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
<p><a href="https://google.com">Visit Google</a></p>
</body>
</html>
Here is a sentence with a footnote.[^1]
[^1]: This is the footnote content.
| Header 1 | Header 2 |
|----------|----------|
| Data 1 | Data 2 |
- [x] Completed Task
- [ ] Incomplete Task
Use emojis like :smile:
or :rocket:
.
The script handles common errors such as missing files or incorrect formats and provides detailed error messages for troubleshooting.
Feel free to submit issues or pull requests to improve the script.
This project is licensed under the MIT License. See the LICENSE
file for details.