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