Skip to content

Latest commit

 

History

52 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WmDP - Markdown Processor

Highly performant markdown processor, WmDP is fairly conventional, however in edge cases results may differ from other parsers.

What WmDP can do...

  • Tables, code blocks, checkboxes, subscript & superscript.
  • Unordered, ordered lists & blockquotes.
  • Italic, cursive, strike-through text.
  • Images, links, titles, etc.

Look in the example directory to see a basic C usage example. To give a more basic understanding of how easy it is to use the library see the below code example.

// Parse Markdown File (Output Size, Input Ptr, Input Size);
char *r=psr(&u,b,s);

The example executable can simply be compiled with gcc main.c -o main -O3 then run it with ./main ../tests.generic.md to generate an .html file.

WebAssembly Usage

There is an embedded usage example in the wasm directory, you can compile the WebAssembly code with the following command.

emcc -O3 ./../md.c -o md.mjs -s EXPORTED_FUNCTIONS='["_psr","_malloc","_free","stringToUTF8"]' -s EXPORTED_RUNTIME_METHODS='["HEAPU8","HEAPU32"]'

Afterwards launch a HTTP server in the same directory and visit it on the localhost.

python3 -m http.server

Reference: [https://developer.mozilla.org/en-US/docs/WebAssembly/Guides/C_to_Wasm]

License

This project is licensed under the permissive MIT license. Please consider starring the project! No AI was used in the making of this project.

Made by Wolf Pieter Schulz.

About

Extremely performant markdown parser, written in ANSI C.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages