kc3-lang/md4c/README.md

Download

Build status (travis-ci.com) Build status (appveyor.com) Coverity Scan Build Status Coverage

MD4C Readme

Home: http://github.com/mity/md4c

MD4C stands for “Markdown for C” and, unsurprisingly, it is a C Markdown parser implementation.

What is Markdown

In short, Markdown is the markup language this README.md file is written in.

The following resources can explain more if you are unfamiliar with it:

What is MD4C

MD4C is C Markdown parser with the following features:

Using MD4C

The parser is implemented in a single C source file md4c.c and its accompanying header md4c.h.

The main provided function is md_parse(). It takes a text in Markdown syntax as an input and a pointer to renderer structure which holds pointers to few callback functions.

As md_parse() processes the input, it calls the appropriate callbacks allowing application to convert it into another format or render it onto the screen.

Refer to the header file for more details, the API is mostly self-explaining and there are some explanatory comments.

Example implementation of simple renderer is available in the md2html directory which implements a conversion utility from Markdown to HTML.

Markdown Extensions

The default behavior is to recognize only elements defined by the CommonMark specification.

However with appropriate renderer flags, the behavior can be tuned to enable some extensions or allowing some deviations from the specification.

Input/Output Encoding

The CommonMark specification generally assumes UTF-8 input, but under closer inspection Unicode is actually used on very few occasions:

MD4C uses this property of the standard and its implementation is, to a large degree, encoding-agnostic. Most of the code only assumes that the encoding of your choice is compatible with ASCII, i.e. that the codepoints below 128 have the same numeric values as ASCII.

All input MD4C does not understand is seen as a text and sent to the callbacks unchanged.

The behavior of MD4C in the isolated situations where the encoding really matters is determined by preprocessor macros:

(Adding support for yet another encodings should be relatively simple due the isolation of the respective code.)

License

MD4C is covered with MIT license, see the file LICENSE.md.

Reporting Bugs

If you encounter any bug, please be so kind and report it. Unheard bugs cannot get fixed. You can submit bug reports here:


Source

Download