2024-05-22 16:01:06 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
attrs,
|
|
|
|
buildPythonPackage,
|
|
|
|
commonmark,
|
|
|
|
fetchFromGitHub,
|
|
|
|
flit-core,
|
|
|
|
linkify-it-py,
|
|
|
|
markdown,
|
|
|
|
mdit-py-plugins,
|
|
|
|
mdurl,
|
|
|
|
mistletoe,
|
|
|
|
mistune,
|
|
|
|
myst-parser,
|
|
|
|
panflute,
|
|
|
|
pyyaml,
|
|
|
|
sphinx,
|
|
|
|
sphinx-book-theme,
|
|
|
|
sphinx-copybutton,
|
|
|
|
sphinx-design,
|
|
|
|
stdenv,
|
|
|
|
pytest-regressions,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2020-12-07 21:18:17 -05:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "markdown-it-py";
|
2023-09-15 14:06:27 +02:00
|
|
|
version = "3.0.0";
|
2021-05-04 00:36:24 -03:00
|
|
|
format = "pyproject";
|
2020-12-07 21:18:17 -05:00
|
|
|
|
2021-05-04 00:36:24 -03:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-12-07 21:18:17 -05:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "executablebooks";
|
2021-05-04 00:36:24 -03:00
|
|
|
repo = pname;
|
2022-07-16 12:59:17 +02:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-09-15 14:06:27 +02:00
|
|
|
hash = "sha256-cmjLElJA61EysTUFMVY++Kw0pI4wOIXOyCY3To9fpQc=";
|
2020-12-07 21:18:17 -05:00
|
|
|
};
|
|
|
|
|
2023-06-26 22:04:00 +02:00
|
|
|
# fix downstrem usage of markdown-it-py[linkify]
|
2024-05-22 16:01:06 +02:00
|
|
|
pythonRelaxDeps = [ "linkify-it-py" ];
|
2023-06-26 22:04:00 +02:00
|
|
|
|
2022-07-16 12:59:17 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flit-core
|
|
|
|
];
|
|
|
|
|
2024-05-22 16:01:06 +02:00
|
|
|
propagatedBuildInputs = [ mdurl ];
|
2020-12-07 21:18:17 -05:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-04 00:36:24 -03:00
|
|
|
pytest-regressions
|
2020-12-07 21:18:17 -05:00
|
|
|
pytestCheckHook
|
2023-02-27 21:42:04 +01:00
|
|
|
] ++ passthru.optional-dependencies.linkify;
|
2021-12-04 10:10:09 +01:00
|
|
|
|
2023-02-27 21:35:00 +01:00
|
|
|
# disable and remove benchmark tests
|
|
|
|
preCheck = ''
|
|
|
|
rm -r benchmarking
|
|
|
|
'';
|
2023-04-25 03:41:55 +02:00
|
|
|
doCheck = !stdenv.isi686;
|
2022-12-31 15:16:10 +01:00
|
|
|
|
2024-05-22 16:01:06 +02:00
|
|
|
pythonImportsCheck = [ "markdown_it" ];
|
2020-12-07 21:18:17 -05:00
|
|
|
|
2023-02-27 21:42:04 +01:00
|
|
|
passthru.optional-dependencies = {
|
2024-05-22 16:01:06 +02:00
|
|
|
compare = [
|
|
|
|
commonmark
|
|
|
|
markdown
|
|
|
|
mistletoe
|
|
|
|
mistune
|
|
|
|
panflute
|
|
|
|
];
|
2023-02-27 21:42:04 +01:00
|
|
|
linkify = [ linkify-it-py ];
|
2023-10-13 13:23:20 +09:00
|
|
|
plugins = [ mdit-py-plugins ];
|
2024-05-22 16:01:06 +02:00
|
|
|
rtd = [
|
|
|
|
attrs
|
|
|
|
myst-parser
|
|
|
|
pyyaml
|
|
|
|
sphinx
|
|
|
|
sphinx-copybutton
|
|
|
|
sphinx-design
|
|
|
|
sphinx-book-theme
|
|
|
|
];
|
2023-02-27 21:42:04 +01:00
|
|
|
};
|
|
|
|
|
2020-12-07 21:18:17 -05:00
|
|
|
meta = with lib; {
|
2021-12-04 10:10:09 +01:00
|
|
|
description = "Markdown parser in Python";
|
|
|
|
homepage = "https://markdown-it-py.readthedocs.io/";
|
2020-12-07 21:19:14 -05:00
|
|
|
changelog = "https://github.com/executablebooks/markdown-it-py/blob/${src.rev}/CHANGELOG.md";
|
2020-12-07 21:18:17 -05:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bhipple ];
|
2023-12-17 17:42:10 -03:00
|
|
|
mainProgram = "markdown-it";
|
2020-12-07 21:18:17 -05:00
|
|
|
};
|
|
|
|
}
|