Compare commits
No commits in common. "a3a6f409dc5c09e0d887db28a4bd6ae2b4a84051" and "90fa34586217de24fa3cc62db061ebd82042122e" have entirely different histories.
a3a6f409dc
...
90fa345862
3 changed files with 21 additions and 12 deletions
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
;(converter :name :gemini :extension ".md" :command "./gemini.sh %OUT %IN")
|
;(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 :markdown :extension ".md" :command "peg-markdown -t html -o %OUT data/%IN")
|
||||||
(converter :name :markdown2 :extension ".md" :command "mm-sh %OUT data/%IN")
|
(converter :name :markdown2 :extension ".md" :command "multimarkdown -o %OUT data/%IN")
|
||||||
(converter :name :org-mode :extension ".org"
|
(converter :name :org-mode :extension ".org"
|
||||||
:command (concatenate 'string
|
:command (concatenate 'string
|
||||||
"emacs data/%IN --batch --eval '(with-temp-buffer (org-mode) "
|
"emacs data/%IN --batch --eval '(with-temp-buffer (org-mode) "
|
||||||
|
|
21
flake.nix
21
flake.nix
|
@ -11,16 +11,6 @@
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system}.extend cl-nix-lite.overlays.default;
|
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
|
in
|
||||||
{
|
{
|
||||||
packages = {
|
packages = {
|
||||||
|
@ -43,7 +33,16 @@
|
||||||
pkgs.asdf
|
pkgs.asdf
|
||||||
pkgs.perl
|
pkgs.perl
|
||||||
pkgs.multimarkdown
|
pkgs.multimarkdown
|
||||||
mm-sh
|
# 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
|
||||||
|
# ''
|
||||||
];
|
];
|
||||||
|
|
||||||
phases = [ "unpackPhase" "installPhase" "cleanupPhase" ];
|
phases = [ "unpackPhase" "installPhase" "cleanupPhase" ];
|
||||||
|
|
10
multimarkdown.sh
Executable file
10
multimarkdown.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/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