1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 pytestCheckHook,
7 markdown,
8 pyyaml,
9 pygments,
10
11 # for passthru.tests
12 mkdocstrings,
13 mkdocs-material,
14 mkdocs-mermaid2-plugin,
15 hydrus,
16}:
17
18let
19 extensions = [
20 "arithmatex"
21 "b64"
22 "betterem"
23 "caret"
24 "critic"
25 "details"
26 "emoji"
27 "escapeall"
28 "extra"
29 "highlight"
30 "inlinehilite"
31 "keys"
32 "magiclink"
33 "mark"
34 "pathconverter"
35 "progressbar"
36 "saneheaders"
37 "smartsymbols"
38 "snippets"
39 "striphtml"
40 "superfences"
41 "tabbed"
42 "tasklist"
43 "tilde"
44 ];
45in
46buildPythonPackage rec {
47 pname = "pymdown-extensions";
48 version = "10.16.1";
49 pyproject = true;
50
51 src = fetchFromGitHub {
52 owner = "facelessuser";
53 repo = "pymdown-extensions";
54 tag = version;
55 hash = "sha256-My1sTzWXInXb4TJ3uB7IXRyUrlbJMxrWyzzge8O0ZmQ=";
56 };
57
58 build-system = [ hatchling ];
59
60 dependencies = [
61 markdown
62 pygments
63 ];
64
65 nativeCheckInputs = [
66 pytestCheckHook
67 pyyaml
68 ];
69
70 disabledTests = [
71 # test artifact mismatch
72 "test_toc_tokens"
73 # Tests fails with AssertionError
74 "test_windows_root_conversion"
75 ];
76
77 pythonImportsCheck = map (ext: "pymdownx.${ext}") extensions;
78
79 passthru.tests = {
80 inherit
81 mkdocstrings
82 mkdocs-material
83 mkdocs-mermaid2-plugin
84 hydrus
85 ;
86 };
87
88 meta = with lib; {
89 description = "Extensions for Python Markdown";
90 homepage = "https://facelessuser.github.io/pymdown-extensions/";
91 license = with licenses; [
92 mit
93 bsd2
94 ];
95 maintainers = with maintainers; [ cpcloud ];
96 };
97}