Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandoc-mustache: init at 0.1.0 #382100

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2352,6 +2352,12 @@
githubId = 97070581;
name = "averagebit";
};
averdow = {
email = "[email protected]";
github = "AaronVerDow";
githubId = 2530548;
name = "Aaron VerDow";
};
averelld = {
email = "[email protected]";
github = "averelld";
Expand Down
47 changes: 47 additions & 0 deletions pkgs/by-name/pa/pandoc-mustache/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
python3Packages,
fetchFromGitHub,
nix-update-script,
callPackage,
lib,
}:

python3Packages.buildPythonApplication rec {
pname = "pandoc-mustache";
version = "0.1.0";
pyproject = true;

src = fetchFromGitHub {
owner = "michaelstepner";
repo = "pandoc-mustache";
tag = "${version}";
hash = "sha256-lgbQV4X2N4VuIEtjeSA542yqGdIs5QQ7+bdCoy/aloE=";
};

build-system = with python3Packages; [
setuptools
pyparsing
];

dependencies = with python3Packages; [
panflute
pystache
pyyaml
future
];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
passthru.updateScript = nix-update-script { };

passthru = {
updateScript = nix-update-script { };
tests = callPackage ./tests { };
};

meta = {
description = "Pandoc Mustache Filter";
homepage = "https://github.com/michaelstepner/pandoc-mustache";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding changelog

Suggested change
homepage = "https://github.com/michaelstepner/pandoc-mustache";
homepage = "https://github.com/michaelstepner/pandoc-mustache";
changelog = "https://github.com/michaelstepner/pandoc-mustache/releases/tag/${version}/CHANGELOG.md"

changelog = "https://github.com/michaelstepner/pandoc-mustache/releases/tag/${version}/CHANGELOG.md";
maintainers = with lib.maintainers; [ averdow ];
license = with lib.licenses; [
cc-by-10
];
};
}
30 changes: 30 additions & 0 deletions pkgs/by-name/pa/pandoc-mustache/tests/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
pkgs,
pandoc-mustache,
runCommand,
}:
let
vars = pkgs.writeText "vars.yaml" ''
place: Montreal
temperature: '7'
'';
markdown = pkgs.writeText "markdown.md" ''
---
title: My Report
author: Jane Smith
mustache: ${vars}
---
The temperature in {{place}} was {{temperature}} degrees.
'';
in
runCommand "pandoc-mustache-test"
{
nativeBuildInputs = [
pandoc-mustache
pkgs.pandoc
];
}
''
pandoc --filter pandoc-mustache ${markdown} --to plain | grep 'The temperature in Montreal was 7 degrees.' || exit 1
touch $out
''