Skip to content

Commit d03162c

Browse files
authored
pandoc-mustache: init at 0.1.0 (#382100)
2 parents e9ad0e6 + 489769f commit d03162c

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
python3Packages,
3+
fetchFromGitHub,
4+
nix-update-script,
5+
callPackage,
6+
lib,
7+
}:
8+
9+
python3Packages.buildPythonApplication rec {
10+
pname = "pandoc-mustache";
11+
version = "0.1.0";
12+
pyproject = true;
13+
14+
src = fetchFromGitHub {
15+
owner = "michaelstepner";
16+
repo = "pandoc-mustache";
17+
tag = "${version}";
18+
hash = "sha256-lgbQV4X2N4VuIEtjeSA542yqGdIs5QQ7+bdCoy/aloE=";
19+
};
20+
21+
build-system = with python3Packages; [
22+
setuptools
23+
pyparsing
24+
];
25+
26+
dependencies = with python3Packages; [
27+
panflute
28+
pystache
29+
pyyaml
30+
future
31+
];
32+
33+
passthru = {
34+
updateScript = nix-update-script { };
35+
tests = callPackage ./tests { };
36+
};
37+
38+
meta = {
39+
description = "Pandoc Mustache Filter";
40+
homepage = "https://github.com/michaelstepner/pandoc-mustache";
41+
changelog = "https://github.com/michaelstepner/pandoc-mustache/releases/tag/${version}/CHANGELOG.md";
42+
maintainers = with lib.maintainers; [ averdow ];
43+
license = with lib.licenses; [
44+
cc-by-10
45+
];
46+
};
47+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
pkgs,
3+
pandoc-mustache,
4+
runCommand,
5+
}:
6+
let
7+
vars = pkgs.writeText "vars.yaml" ''
8+
place: Montreal
9+
temperature: '7'
10+
'';
11+
markdown = pkgs.writeText "markdown.md" ''
12+
---
13+
title: My Report
14+
author: Jane Smith
15+
mustache: ${vars}
16+
---
17+
The temperature in {{place}} was {{temperature}} degrees.
18+
'';
19+
in
20+
runCommand "pandoc-mustache-test"
21+
{
22+
nativeBuildInputs = [
23+
pandoc-mustache
24+
pkgs.pandoc
25+
];
26+
}
27+
''
28+
pandoc --filter pandoc-mustache ${markdown} --to plain | grep 'The temperature in Montreal was 7 degrees.' || exit 1
29+
touch $out
30+
''

0 commit comments

Comments
 (0)