1{
2 buildPythonPackage,
3 fetchFromGitHub,
4 pkgs, # Only for pkgs.graphviz
5 lib,
6 setuptools,
7 markdown,
8}:
9
10buildPythonPackage rec {
11 pname = "markdown-inline-graphviz";
12 version = "1.1.3";
13 pyproject = true;
14
15 src = fetchFromGitHub {
16 owner = "cesaremorel";
17 repo = "markdown-inline-graphviz";
18 tag = "v${version}";
19 hash = "sha256-FUBRFImX5NOxyYAK7z5Bo8VKVQllTbEewEGZXtVMBQE=";
20 };
21
22 # Using substituteInPlace because there's only one replacement
23 postPatch = ''
24 substituteInPlace markdown_inline_graphviz.py \
25 --replace-fail "args = [command, '-T'+filetype]" "args = [\"${pkgs.graphviz}/bin/\" + command, '-T'+filetype]"
26 '';
27
28 build-system = [ setuptools ];
29
30 dependencies = [ markdown ];
31
32 # No tests available
33 doCheck = false;
34
35 pythonImportsCheck = [ "markdown_inline_graphviz" ];
36
37 meta = {
38 description = "Render inline graphs with Markdown and Graphviz";
39 homepage = "https://github.com/cesaremorel/markdown-inline-graphviz/";
40 changelog = "https://github.com/cesaremorel/markdown-inline-graphviz/releases/tag/${src.tag}";
41 license = lib.licenses.mit;
42 maintainers = with lib.maintainers; [ ];
43 };
44}