2022-08-12 12:06:08 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, lib
|
|
|
|
, plantuml
|
|
|
|
, markdown
|
|
|
|
, requests
|
|
|
|
, six
|
|
|
|
, runCommand
|
|
|
|
, writeText
|
|
|
|
, plantuml-markdown
|
2023-05-24 13:37:59 +00:00
|
|
|
, 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-02-29 20:09:43 +00:00
|
|
|
version = "3.9.3";
|
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-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-2nZV/bYRN1SKI6OmpOhK7KUuBwmwhTt/ErTYqVQ9Dps=";
|
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;
|
|
|
|
|
2023-05-24 13:37:59 +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
|
|
|
|
runCommand "plantuml-markdown-example-doc"
|
|
|
|
{
|
|
|
|
nativeBuildInputs = [ plantuml-markdown ];
|
|
|
|
} ''
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|