# HG changeset patch # User Henry Thompson # Date 1721144283 -3600 # Node ID b3cffcadc1c2c7937a83cb8993bb83a3372cc924 # Parent 7341dbbeaf28e129baf121322d6769e60743fa93 for fixup of pandoc output diff -r 7341dbbeaf28 -r b3cffcadc1c2 MHMC/minutes.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MHMC/minutes.el Tue Jul 16 16:38:03 2024 +0100 @@ -0,0 +1,48 @@ +;;; sed 's/^ *//' notes.txt|/c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -s -f markdown -t html4 > notes.html + +;;; from before pandoc +(defalias 'format-action (read-kbd-macro +"C-s ACTION: SPC RET C-SPC

C-M-s C-q C-j C-q C-j RET C-b

")) + +(defun fix-html () + (interactive) + (goto-char (point-min)) + (forward-line 2) + (sgml-forward-element) + (forward-char 1) + (kill-region (point-min) (point)) + (fix-divs) + (goto-char (point-min)) + (fix-dls) + (goto-char (point-min)) + (insert-file "/home/ht/Documents/RSoF/MHMC/doc-head.ent") + (goto-char (point-max)) + (forward-line -2) + (beginning-of-line) + (insert "\n") + (forward-line 1) + (beginning-of-line) + (kill-line) + (insert "") + (goto-char (point-min)) + (search-forward "" nil t) + ) + +(defun fix-dls () + (interactive) + (replace-string "dl>" "list>") + (goto-char (point-min)) + (replace-regexp "<dt>\\([^<]*\\)</dt>\n" "<item term='\\1'>") + (goto-char (point-min)) + (replace-string "<dd>\n" "") + (goto-char (point-min)) + (replace-string "</dd>" "</item>") + ) +(defun fix-divs () + (interactive) + (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1") + (goto-char (point-min)) + (replace-regexp "\\(

\n\\)\\([ ]*\\)\\(\n\\2\\3") + (goto-char (point-min)) + (replace-string "

ACTION: " "

") + (goto-char (point-min)))