1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, hatchling
5, pytestCheckHook
6, markdown
7, pyyaml
8, pygments
9
10# for passthru.tests
11, mkdocstrings
12, mkdocs-material
13, mkdocs-mermaid2-plugin
14, hydrus
15}:
16
17let
18 extensions = [
19 "arithmatex"
20 "b64"
21 "betterem"
22 "caret"
23 "critic"
24 "details"
25 "emoji"
26 "escapeall"
27 "extra"
28 "highlight"
29 "inlinehilite"
30 "keys"
31 "magiclink"
32 "mark"
33 "pathconverter"
34 "progressbar"
35 "saneheaders"
36 "smartsymbols"
37 "snippets"
38 "striphtml"
39 "superfences"
40 "tabbed"
41 "tasklist"
42 "tilde"
43 ];
44in
45buildPythonPackage rec {
46 pname = "pymdown-extensions";
47 version = "10.3";
48 format = "pyproject";
49
50 src = fetchFromGitHub {
51 owner = "facelessuser";
52 repo = "pymdown-extensions";
53 rev = "refs/tags/${version}";
54 hash = "sha256-R35R2dHfjcVQbEa2319FEMjPGl1Y5/u2KEHeR0wTYEo=";
55 };
56
57 nativeBuildInputs = [ hatchling ];
58
59 propagatedBuildInputs = [ markdown pygments ];
60
61 nativeCheckInputs = [
62 pytestCheckHook
63 pyyaml
64 ];
65
66 pythonImportsCheck = map (ext: "pymdownx.${ext}") extensions;
67
68 passthru.tests = {
69 inherit mkdocstrings mkdocs-material mkdocs-mermaid2-plugin hydrus;
70 };
71
72 meta = with lib; {
73 description = "Extensions for Python Markdown";
74 homepage = "https://facelessuser.github.io/pymdown-extensions/";
75 license = with licenses; [ mit bsd2 ];
76 maintainers = with maintainers; [ cpcloud ];
77 };
78}