pandoc-acro: init at 0.10.1

This commit is contained in:
Jacek Galowicz 2022-02-23 12:26:24 +01:00
parent 656e4a4515
commit f27d4c8790
2 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,69 @@
{ buildPythonApplication
, fetchPypi
, pandocfilters
, panflute
, lib
, pandoc
, pandoc-acro
, texlive
, runCommand
}:
let
pname = "pandoc-acro";
version = "0.10.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-JMfSQXX+BCGdFQYPFB+r08WRnhT3aXfnBNINROxCUA0=";
};
in
buildPythonApplication {
inherit pname version src;
propagatedBuildInputs = [
pandocfilters
panflute
];
# Something in the tests does not typecheck, but the tool works well.
doCheck = false;
passthru.tests.example-doc =
let
env = {
nativeBuildInputs = [
pandoc
pandoc-acro
(texlive.combine {
inherit (texlive)
scheme-tetex
acro
translations
;
})
];
};
in
runCommand "pandoc-acro-example-docs" env ''
set -euo pipefail
exampleFile="${pname}-${version}/tests/example.md"
metadataFile="${pname}-${version}/tests/metadata.yaml"
tar --extract "--file=${src}" "$exampleFile" "$metadataFile"
mkdir $out
pandoc -F pandoc-acro "$exampleFile" "--metadata-file=$metadataFile" \
-T pdf -o $out/example.pdf
pandoc -F pandoc-acro "$exampleFile" "--metadata-file=$metadataFile" \
-T txt -o $out/example.txt
! grep -q "\+afaik" $out/example.txt
'';
meta = with lib; {
homepage = "https://pypi.org/project/pandoc-acro/";
description = "Pandoc filter which manages acronyms in Pandoc flavored Markdown sources";
license = licenses.bsd2;
maintainers = with maintainers; [ tfc ];
};
}

View File

@ -8273,6 +8273,8 @@ with pkgs;
pa_applet = callPackage ../tools/audio/pa-applet { };
pandoc-acro = python3Packages.callPackage ../tools/misc/pandoc-acro { };
pandoc-imagine = python3Packages.callPackage ../tools/misc/pandoc-imagine { };
pandoc-drawio-filter = python3Packages.callPackage ../tools/misc/pandoc-drawio-filter { };