o
odinpkg.dev
packages / library / markdown-to-html

markdown-to-html

1.1library

Markdown to HTML tokenizer and converter

No license · updated 6 months ago

Markdown to HTML converter and tokenizer

This project supports UTF-8 files and tokens, and is able to convert markdown files to html files, within a nice CLI interface.

Compiling locally

To run compile this locally, you need to install the latest version of the odin compiler and its dependencies: https://odin-lang.org/docs/install/

Then you can make use of the 2 shell scripts in the repo's root directory:

./run.sh -> runs the main.odin file in the src/ directory, outputting the binary in the bin/ directory

./build.sh -> builds the project in the src/ directory, outputting the binary in the bin/ directory, optimized for release.

./test.sh -> runs the tests for the tokenizer package, then the main package, outputting the binaries in the bin/ directory

NOTE:

The parser for this doesn't use recursive composition, which means that some nested structures may not work properly.

Usage Instructions:

Usage: md_to_html [path_to_markdown] [path_to_html] [force_flag] [inline_flag]

  • path_to_markdown: path to the markdown file you wish to convert

  • path_to_html (optional): output path of the converted html file

  • force_flag ("--force"|"") (optional): If set, overrides the check for already existing output files, overriding whatever is in the path_to_html file.

  • inline_flag ("--inline"|"") (optional): If set, outputs the html directly inline. Useful for using in bash scripts.

If [path_to_html] and [inline_flag] are not specified, the program will create an "output.html" file in the directory where the program was called from.