2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
plantuml,
|
|
|
|
markdown,
|
|
|
|
requests,
|
|
|
|
six,
|
|
|
|
runCommand,
|
|
|
|
writeText,
|
|
|
|
plantuml-markdown,
|
|
|
|
pythonOlder,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "plantuml-markdown";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "3.9.7";
|
2023-05-24 13:37:59 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mikitex70";
|
|
|
|
repo = pname;
|
2022-09-30 11:47:45 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-/lsu7kiUyQ6LUFINX+/aCFSKm1pGyIfUzSuUehwCz7I=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
plantuml
|
|
|
|
markdown
|
|
|
|
requests
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
|
|
|
# The package uses a custom script that downloads a certain version of plantuml for testing.
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "plantuml_markdown" ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
passthru.tests.example-doc =
|
|
|
|
let
|
|
|
|
exampleDoc = writeText "plantuml-markdown-example-doc.md" ''
|
|
|
|
```plantuml
|
|
|
|
Bob -> Alice: Hello
|
|
|
|
```
|
|
|
|
'';
|
|
|
|
in
|
2024-06-05 15:53:02 +00:00
|
|
|
runCommand "plantuml-markdown-example-doc" { nativeBuildInputs = [ plantuml-markdown ]; } ''
|
2022-08-12 12:06:08 +00:00
|
|
|
markdown_py -x plantuml_markdown ${exampleDoc} > $out
|
|
|
|
|
|
|
|
! grep -q "Error" $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "PlantUML plugin for Python-Markdown";
|
|
|
|
longDescription = ''
|
|
|
|
This plugin implements a block extension which can be used to specify a PlantUML
|
|
|
|
diagram which will be converted into an image and inserted in the document.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/mikitex70/plantuml-markdown";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/mikitex70/plantuml-markdown/releases/tag/${version}";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ nikstur ];
|
|
|
|
};
|
|
|
|
}
|