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