1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 markdown-it-py,
6 pytestCheckHook,
7 pythonOlder,
8 setuptools,
9}:
10
11buildPythonPackage rec {
12 pname = "mdformat";
13 version = "0.7.22";
14 pyproject = true;
15
16 disabled = pythonOlder "3.12";
17
18 src = fetchFromGitHub {
19 owner = "executablebooks";
20 repo = "mdformat";
21 tag = version;
22 hash = "sha256-WvbGCqfzh7KlNXIGJq09goiyLzVgU7c1+qmsLrIW38k=";
23 };
24
25 build-system = [ setuptools ];
26
27 dependencies = [ markdown-it-py ];
28
29 nativeCheckInputs = [ pytestCheckHook ];
30
31 pythonImportsCheck = [ "mdformat" ];
32
33 passthru = {
34 withPlugins = throw "Use pkgs.mdformat.withPlugins, i.e. the top-level attribute.";
35 };
36
37 meta = with lib; {
38 description = "CommonMark compliant Markdown formatter";
39 homepage = "https://mdformat.rtfd.io/";
40 changelog = "https://github.com/executablebooks/mdformat/blob/${version}/docs/users/changelog.md";
41 license = licenses.mit;
42 maintainers = with maintainers; [
43 fab
44 aldoborrero
45 ];
46 mainProgram = "mdformat";
47 };
48}