Rename the program to katex-html

This commit is contained in:
Danila Fedorin 2022-03-27 18:29:38 -07:00
parent 0caba82b7c
commit fc26bcf07b

View File

@ -11,21 +11,21 @@ let
};
in
stdenv.mkDerivation {
name = "katex-converter";
name = "katex-html";
src = ./convert.rb;
buildInputs = [ katex-server gems ruby ];
unpackPhase = "echo 'Skipping unpack phase (nothing to unpack)'";
installPhase = ''
mkdir -p $out/{bin,share/katex-converter}
cp $src $out/share/katex-converter/convert.rb
cat > $out/bin/katex-converter <<EOF
mkdir -p $out/{bin,share/katex-html}
cp $src $out/share/katex-html/convert.rb
cat > $out/bin/katex-html <<EOF
#!/bin/sh -e
${katex-server}/bin/katex-server &
server_pid=\$!
sleep 1
${gems}/bin/bundle exec ${ruby}/bin/ruby $out/share/katex-converter/convert.rb \$@
${gems}/bin/bundle exec ${ruby}/bin/ruby $out/share/katex-html/convert.rb \$@
kill -KILL \$server_pid
EOF
chmod +x $out/bin/katex-converter
chmod +x $out/bin/katex-html
'';
}