Commit 52e9eeb

xxwhirlpool  ·  2025-10-22 19:05:44 -0400 EDT
parent 5ad84fb
fixes for md2html
1 files changed,  +6, -2
+6, -2
......@@ -4,14 +4,14 @@
44 # can read from STDIN or file
55 #
66 # this is a *very* opinionated script, using:
7-# gum, bat, perl, and xclip
7+# gum, bat, perl, openssl, and xclip
88 # pandoc is mandatory!!!
99 # edit to suit your system
1010
1111 # functions
1212 read() {
1313 # declare some vars
14- MDFILE="/tmp/$(today time && openssl rand -hex 5).md"
14+ MDFILE="/tmp/$(openssl rand -hex 5).md"
1515 HTMLFILE="${MDFILE%.*}.html"
1616 HTMLFILE_FINAL="${HTMLFILE%.*}_final.html"
1717 # prompt user to paste markdown formatted text, then write it to a temp file
......@@ -24,6 +24,8 @@ read() {
2424 batcat --paging=never "$HTMLFILE_FINAL"
2525 # copy file to clipboard too
2626 xclip -sel clip "$HTMLFILE_FINAL"
27+ # cleanup
28+ rm "$HTMLFILE"
2729 }
2830
2931 fromfile() {
......@@ -39,6 +41,8 @@ fromfile() {
3941 batcat --paging=never "$HTMLFILE_FINAL"
4042 # copy file to clipboard too
4143 xclip -sel clip "$HTMLFILE_FINAL"
44+ # cleanup
45+ rm "$HTMLFILE"
4246 }
4347
4448 # execute it