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.7.1";
49 format = "pyproject";
50
51 src = fetchFromGitHub {
52 owner = "facelessuser";
53 repo = "pymdown-extensions";
54 rev = "refs/tags/${version}";
55 hash = "sha256-P2MkGD0B9mn34ia3Kd4MQej1XryNVXWVMF4JHaPTS0M=";
56 };
57
58 nativeBuildInputs = [ hatchling ];
59
60 propagatedBuildInputs = [
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 ];
74
75 pythonImportsCheck = map (ext: "pymdownx.${ext}") extensions;
76
77 passthru.tests = {
78 inherit
79 mkdocstrings
80 mkdocs-material
81 mkdocs-mermaid2-plugin
82 hydrus
83 ;
84 };
85
86 meta = with lib; {
87 description = "Extensions for Python Markdown";
88 homepage = "https://facelessuser.github.io/pymdown-extensions/";
89 license = with licenses; [
90 mit
91 bsd2
92 ];
93 maintainers = with maintainers; [ cpcloud ];
94 };
95}