Mercurial > hg > rsof
view MHMC/minutes.el @ 495:b3cffcadc1c2
for fixup of pandoc output
author | Henry Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 16 Jul 2024 16:38:03 +0100 |
parents | |
children | 34129b221ffa |
line wrap: on
line source
;;; 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 <M-backspace> <p SPC class='a'> C-M-s C-q C-j C-q C-j RET <backspace> C-b </p>")) (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 "</div>\n") (forward-line 1) (beginning-of-line) (kill-line) (insert "</doc>") (goto-char (point-min)) (search-forward "<title>" 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</title>") (goto-char (point-min)) (replace-regexp "\\(</p>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\2</div>\n\\2\\3") (goto-char (point-min)) (replace-string "<p>ACTION: " "<p class='a'>") (goto-char (point-min)))