A lightweight tool that parses Markdown files into HTML and serves them locally using a built-in HTTP server.
- Markdown Parsing: Powered by cmark for reliable CommonMark compliance.
- Local Rendering: Hosts the rendered HTML directly through a built-in HTTP server so you can view files in your browser.
- GCC or any standard C compiler
- Make build system
- cmark development libraries installed on your system.
-
Clone the repository:
git clone https://github.com/r1shavd/md-renderer.git cd md-renderer -
Build the project:
make # Or, use this to compile with mongoose version make mongoose
To start the built-in HTTP server and render your Markdown file, run the following command:
./bin/md-renderer <markdown-file.md> --ip-address <host-address> --port <port>Example:
./bin/md-renderer README.md --port 8000Once running, open your web browser and navigate to http://127.0.0.1:8000 to view your rendered document.
Use the --help flag for additional configuration options:
./bin/md-renderer --help- common-mark/cmark — Required for parsing Markdown files to HTML.
- cesanta/mongoose - Required for hosting the parsed markdown files. Use the make mongoose version to compile this version. Other versions, reduce this dependencies sacrifising stability to use native SOCKET HTTP server.