A lightweight and efficient Markdown to HTML compiler written in Rust. This compiler transforms Markdown syntax into clean, semantic HTML.
Supports three levels of headers using the #
syntax:
#
for the highest level (h1)##
for the second level (h2)###
for the third level (h3)
Supports bold and italic text using the **
and *
syntax:
**text**
for bold text*text*
for italic text
Automatically wraps text in <p>
tags when no other tags are present.
Use single tildes: H~2~O
becomes H2O
Use carets: 2^nd^
becomes 2nd
Use double percent signs: %%smaller text%%
Use double equals signs: ==highlighted text==
Use [@text@title] syntax: [@WHO@World Health Organization]
cargo run <input_file.md>
The compiler will generate an output.html
file in the same directory as the input file.
See the test.md
file for an example of the compiler in action.
- Clone the repository
git clone https://github.com/awwyushh/md_compiler
- Build your project
cd md_compiler
cargo build --release
- Run your project
cargo run test.md
src/parse_markdown.rs
: Parses the markdown file and outputs the HTML file.src/main.rs
: The main entry point for the program.test.md
: An example markdown file to test the compiler.output.html
: The output HTML file generated by the compiler.
- Add support for ordered lists
- Add support for unordered lists
- Add support for links
- Add support for images
- Add support for tables
- Add support for code blocks
- Add support for blockquotes
- Add support for horizontal rules
- Add support for line breaks
- Add support for strikethrough text
- Add support for subscript and superscript text
- Add support for small text
- Add support for mark text
- Add support for abbreviations
- Add support for subscript and superscript text
- Add support for small text
- Add support for mark text
- Add support for ruby annotations
This project is open-sourced under the MIT License - see the LICENSE file for details.