Marcus
Description:
Marcus is an experimental Markdown parser written in Rust. It uses regular expressions and built-in methods (for the str & String types) to convert Markdown into HTML.
Note: Certain test files (*.md) aren't rendered properly by Github Preview due to a lack of support for the full Markdown specification.
Warning: This project is experimental and isn't production tested. Make sure to backup all files when working with file I/O.
Demonstration:
Include the following dependencies in the [dependencies] section of the Cargo.toml file:
glob = "0.3.0"
marcus = "0.1.0"
The Marcus package can also be included from the Github repository:
glob = "0.3.0"
marcus =
The following helper functions are used to simplify file I/O and to improve error handling.
use glob;
use fs;
Define the fileio module (contains the helper functions above), and import the marcus package:
use marcus;
In the body of the main function, use fileio::walk to get a list of file paths and read the contents of each file using fileio::read_file. Then convert each file's contents to HTML using marcus::to_string and use fileio::write_file to store the HTML result to a .html file of the same name.
// Glob the MD test files
for file_path in walk
Note: The test files (.md) used in this demonstration and their corresponding outputs (.html) are available to download on the Marcus-Docs repository.
Licence:
The source code included in this repository is distributed, for free, under the MIT Licence, for the full license, see LICENSE.md.