Skip to content
forked from NixOS/nixpkgs

Commit

Permalink
relaxed: init at unstable-2022-03-26
Browse files Browse the repository at this point in the history
  • Loading branch information
Flakebi committed Dec 21, 2023
1 parent d088964 commit 8449629
Show file tree
Hide file tree
Showing 6 changed files with 8,011 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkgs/tools/typesetting/relaxed/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ lib, fetchFromGitHub, makeWrapper, mkYarnPackage, chromium }:
mkYarnPackage rec {
pname = "relaxed";
version = "unstable-2022-03-26";

src = fetchFromGitHub {
owner = "RelaxedJS";
repo = "ReLaXed";
rev = "7b8d06ba2a863a37ed38279ecc7df6512d6cb2e4";
hash = "sha256-JBBsUFAAidKmHYJMj6v7aIJUGpz/iykFFJr8gnglOKc=";
};

packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;

nativeBuildInputs = [ makeWrapper ];

postInstall = ''
wrapProgram $out/bin/relaxed \
--set PUPPETEER_EXECUTABLE_PATH ${chromium}/bin/chromium
'';

meta = with lib; {
homepage = "https://github.com/RelaxedJS/ReLaXed";
description = "Creates PDF documents interactively using HTML or Pug";
license = licenses.isc;
maintainers = with maintainers; [ Flakebi ];
};
}
46 changes: 46 additions & 0 deletions pkgs/tools/typesetting/relaxed/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "relaxedjs",
"version": "0.2.5",
"description": "Create PDF documents using web technologies (PDF/SCSS)",
"main": "src/masterToPDF.js",
"bin": {
"relaxed": "src/index.js",
"pretty-pdf-thumbnail": "src/cli-tools/pretty-pdf-thumbnail.js",
"pdf2gif": "src/cli-tools/pdf2gif.js"
},
"scripts": {
"test": "mocha"
},
"author": "Zulko",
"homepage": "https://github.com/RelaxedJS",
"license": "ISC",
"dependencies": {
"@iktakahiro/markdown-it-katex": "^4.0.1",
"cheerio": "^1.0.0-rc.2",
"chokidar": "^3.5.3",
"colors": "^1.3.0",
"commander": "^9.1.0",
"csvtojson": "^2.0.3",
"deptree": "^1.0.0",
"filesize": "^8.0.7",
"html2jade": "^0.8.6",
"jimp": "^0.16.1",
"js-yaml": "^4.1.0",
"jstransformer-highlight": "^2.0.0",
"jstransformer-markdown-it": "^2.1.0",
"katex": "^0.15.3",
"markdown-it": "^12.3.0",
"markdown-it-footnote": "^3.0.3",
"mathjax-node-page": "^3.0.1",
"mermaid": "^8.0.0-rc.8",
"pug": "^3.0.2",
"puppeteer": "^13.5.1",
"sass": "^1.49.9"
},
"devDependencies": {
"diff": "^5.0.0",
"mocha": "^9.2.2",
"pdf-image": "^2.0.0",
"pixel-diff": "^1.0.1"
}
}
13 changes: 13 additions & 0 deletions pkgs/tools/typesetting/relaxed/wrapper.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ lib, makeWrapper, runCommand, asciidoctor-web-pdf-unwrapped, plugins ? [] }:
let
pluginPath = lib.concatStringsSep ":" (map (p: "${p}/libexec/${p.pname}/node_modules") plugins);
in runCommand "asciidoctor-web-pdf" {
inherit (asciidoctor-web-pdf-unwrapped) pname version meta;

buildInputs = [ makeWrapper ];
} ''
mkdir -p $out/bin
for name in asciidoctor-web-pdf asciidoctor-pdf; do
makeWrapper ${asciidoctor-web-pdf-unwrapped}/bin/$name $out/bin/$name --set NODE_PATH "${pluginPath}"
done
''

0 comments on commit 8449629

Please sign in to comment.