8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
15 rev = "release-${version}";
16 hash = "sha256-+LObAD5JB8Vb4Rt4hTo1Z4ispxzfFkkXA2sw6TKB7Yo=";
20 # We set CMAKE_INSTALL_LIBDIR to the absolute path in $out, so
21 # prefix and exec_prefix cannot be $out, too
22 # Use CMake's _FULL_ variables instead of `prefix` concatenation.
32 description = "Markdown parser made in C";
34 MD4C is Markdown parser implementation in C, with the following features:
36 - Compliance: Generally, MD4C aims to be compliant to the latest version
37 of CommonMark specification. Currently, we are fully compliant to
39 - Extensions: MD4C supports some commonly requested and accepted
40 extensions. See below.
41 - Performance: MD4C is very fast.
42 - Compactness: MD4C parser is implemented in one source file and one
43 header file. There are no dependencies other than standard C library.
44 - Embedding: MD4C parser is easy to reuse in other projects, its API is
45 very straightforward: There is actually just one function, md_parse().
46 - Push model: MD4C parses the complete document and calls few callback
47 functions provided by the application to inform it about a start/end of
48 every block, a start/end of every span, and with any textual contents.
49 - Portability: MD4C builds and works on Windows and POSIX-compliant
50 OSes. (It should be simple to make it run also on most other platforms,
51 at least as long as the platform provides C standard library, including
52 a heap memory management.)
53 - Encoding: MD4C by default expects UTF-8 encoding of the input
54 document. But it can be compiled to recognize ASCII-only control
55 characters (i.e. to disable all Unicode-specific code), or (on Windows)
56 to expect UTF-16 (i.e. what is on Windows commonly called just
57 "Unicode"). See more details below.
58 - Permissive license: MD4C is available under the MIT license.
60 homepage = "https://github.com/mity/md4c";
61 license = licenses.mit;
62 maintainers = with maintainers; [ AndersonTorres ];
63 mainProgram = "md2html";
64 platforms = platforms.all;
67 # TODO: enable tests (needs Python)