Compare commits
2 commits
90fa345862
...
a3a6f409dc
Author | SHA1 | Date | |
---|---|---|---|
a3a6f409dc | |||
afc44a56df |
3 changed files with 12 additions and 21 deletions
|
@ -23,7 +23,7 @@
|
|||
|
||||
;(converter :name :gemini :extension ".md" :command "./gemini.sh %OUT %IN")
|
||||
(converter :name :markdown :extension ".md" :command "peg-markdown -t html -o %OUT data/%IN")
|
||||
(converter :name :markdown2 :extension ".md" :command "multimarkdown -o %OUT data/%IN")
|
||||
(converter :name :markdown2 :extension ".md" :command "mm-sh %OUT data/%IN")
|
||||
(converter :name :org-mode :extension ".org"
|
||||
:command (concatenate 'string
|
||||
"emacs data/%IN --batch --eval '(with-temp-buffer (org-mode) "
|
||||
|
|
21
flake.nix
21
flake.nix
|
@ -11,6 +11,16 @@
|
|||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system}.extend cl-nix-lite.overlays.default;
|
||||
mm-sh = pkgs.writeShellScriptBin "mm-sh" ''
|
||||
#!/bin/sh
|
||||
cat data/$2 |perl -0pe 's/\[\^(.*?)\]\:(.*?)(\n\n)/\<span class="marginnote"\>\2\<\/span\>/gms' > $1.tmp
|
||||
# perl -0pe 's/\[\^(.*?)\][^:]/\<label for\="\1" class\="margin-toggle"\>/gms'
|
||||
multimarkdown -t html -o $1 $1.tmp && cat $1 |
|
||||
perl -0pe 's/(\<h2|^)(.*?)(?=(\<h2)|\Z)/\n\<section\>\n\1\2\n<\/section\>\n/gms' |
|
||||
perl -0pe 's/(\<blockquote\>.*?\<\/blockquote\>)/\<div class="epigraph"\>\n\1\n\<\/div\>/gms' |
|
||||
perl -0pe 's/(\<blockquote\>.*?)\n(–.*?)(\<\/blockquote\>)/\1\<footer\>\2\<\/footer\>\3/gms' > $1.new && mv $1.new $1
|
||||
rm $1.tmp
|
||||
'';
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
|
@ -33,16 +43,7 @@
|
|||
pkgs.asdf
|
||||
pkgs.perl
|
||||
pkgs.multimarkdown
|
||||
# pkgs.writeShellScript "mm-sh" ''
|
||||
# #!/bin/sh
|
||||
# cat data/$2 |perl -0pe 's/\[\^(.*?)\]\:(.*?)(\n\n)/\<span class="marginnote"\>\2\<\/span\>/gms' > $1.tmp
|
||||
# # perl -0pe 's/\[\^(.*?)\][^:]/\<label for\="\1" class\="margin-toggle"\>/gms'
|
||||
# multimarkdown -t html -o $1 $1.tmp && cat $1 |
|
||||
# perl -0pe 's/(\<h2|^)(.*?)(?=(\<h2)|\Z)/\n\<section\>\n\1\2\n<\/section\>\n/gms' |
|
||||
# perl -0pe 's/(\<blockquote\>.*?\<\/blockquote\>)/\<div class="epigraph"\>\n\1\n\<\/div\>/gms' |
|
||||
# perl -0pe 's/(\<blockquote\>.*?)\n(–.*?)(\<\/blockquote\>)/\1\<footer\>\2\<\/footer\>\3/gms' > $1.new && mv $1.new $1
|
||||
# rm $1.tmp
|
||||
# ''
|
||||
mm-sh
|
||||
];
|
||||
|
||||
phases = [ "unpackPhase" "installPhase" "cleanupPhase" ];
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
cat data/$2 | ${perl} -0pe 's/\[\^(.*?)\]\:(.*?)(\n\n)/\<span class="marginnote"\>\2\<\/span\>/gms' > $1.tmp
|
||||
# perl -0pe 's/\[\^(.*?)\][^:]/\<label for\="\1" class\="margin-toggle"\>/gms'
|
||||
${multimarkdown} -t html -o $1 $1.tmp && cat $1 |
|
||||
${perl} -0pe 's/(\<h2|^)(.*?)(?=(\<h2)|\Z)/\n\<section\>\n\1\2\n<\/section\>\n/gms' |
|
||||
${perl} -0pe 's/(\<blockquote\>.*?\<\/blockquote\>)/\<div class="epigraph"\>\n\1\n\<\/div\>/gms' |
|
||||
${perl} -0pe 's/(\<blockquote\>.*?)\n(–.*?)(\<\/blockquote\>)/\1\<footer\>\2\<\/footer\>\3/gms' > $1.new && mv $1.new $1
|
||||
|
||||
rm $1.tmp
|
Loading…
Add table
Reference in a new issue