about summary refs log tree commit diff
path: root/pkgs/development/web/remarkjs
diff options
context:
space:
mode:
authorRickard Nilsson <rickynils@gmail.com>2014-04-20 22:42:55 +0200
committerRickard Nilsson <rickynils@gmail.com>2014-04-21 01:27:23 +0200
commit6b634673f9eb89f7280050e07088041ec7ec4575 (patch)
tree7df1af4b765e81b38c53d6404d0b7c7bae4eeea5 /pkgs/development/web/remarkjs
parent31a94915d2532273e3630206a9e13f2e49ce0775 (diff)
downloadnixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar.gz
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar.bz2
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar.lz
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar.xz
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.tar.zst
nixlib-6b634673f9eb89f7280050e07088041ec7ec4575.zip
Add remarkjs 0.6.4, a markdown-driven slideshow tool
Also, add required node packages (and update generated node pkgs).
Diffstat (limited to 'pkgs/development/web/remarkjs')
-rw-r--r--pkgs/development/web/remarkjs/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/development/web/remarkjs/default.nix b/pkgs/development/web/remarkjs/default.nix
new file mode 100644
index 000000000000..bf96175b8cd0
--- /dev/null
+++ b/pkgs/development/web/remarkjs/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, lib, fetchgit, fetchurl, nodejs, nodePackages }:
+
+with lib;
+
+let
+
+  # highlight.js is a git submodule of remark
+  highlightjs = fetchgit {
+    url = https://github.com/isagalaev/highlight.js;
+    rev = "10b9500b67983f0a9c42d8ce8bf8e8c469f7078c";
+    sha256 = "1yy8by15kfklw8lwh17z1swpj067q0skjjih12yawbryraig41m0";
+  };
+
+in stdenv.mkDerivation rec {
+  name = "remarkjs-${version}";
+
+  version = "0.6.4";
+
+  src = fetchurl {
+    url = "https://github.com/gnab/remark/archive/v${version}.tar.gz";
+    sha256 = "0sdhpn91b05qdqfqbfrhkfx8rkqrgm9pqg4bgjhxf9prfjhvmlrn";
+  };
+
+  buildInputs = with nodePackages; [
+    nodejs
+    marked
+    browserify
+    uglify-js
+    less
+    mocha
+    mocha-phantomjs
+    phantomjs
+    should
+    sinon
+    jshint
+    shelljs
+  ];
+
+  configurePhase = ''
+    mkdir -p node_modules/.bin
+    ${concatStrings (map (dep: ''
+      test -d ${dep}/bin && (for b in $(ls ${dep}/bin); do
+        ln -sv -t node_modules/.bin ${dep}/bin/$b
+      done)
+    '') buildInputs)}
+  '';
+
+  buildPhase = ''
+    substituteInPlace make.js --replace "target.test();" ""
+    substituteInPlace make.js --replace vendor/highlight.js ${highlightjs}
+    node make all
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp -v out/* $out/lib/
+  '';
+
+  meta = {
+    homepage = http://remarkjs.com;
+    description = "A simple, in-browser, markdown-driven slideshow tool.";
+    maintainers = [ stdenv.lib.maintainers.rickynils ];
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.mit;
+  };
+}