Mercurial > hg > rsof
changeset 548:5def9134830d
unknown
author | Henry S Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 18 Sep 2024 15:14:36 +0100 |
parents | a9439e3247ab |
children | 497678611945 51c427b0b746 |
files | MHMC/minutes.el |
diffstat | 1 files changed, 9 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/MHMC/minutes.el Wed Sep 18 15:13:55 2024 +0100 +++ b/MHMC/minutes.el Wed Sep 18 15:14:36 2024 +0100 @@ -1,5 +1,8 @@ -;;; /c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -N -f markdown -t html4 > notes.html -;;; Use -s if you want to just see the pandoc html as such, e.g. for an agenda to be emailed verbatim +;;; 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) @@ -8,6 +11,8 @@ (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") @@ -24,17 +29,7 @@ (goto-char (point-min)) (replace-string "strong>" "name>") (goto-char (point-min)) - (let* ((hb (search-forward "<title>" nil t)) - (tb (search-forward "<title>" nil t)) - (te (- (search-forward "</title>") 8)) - (tt (buffer-substring tb te))) - (goto-char hb) - (insert tt)) - (search-forward "<div id=\"header\"" nil t) - (beginning-of-line) - (kill-line) - (forward-line 2) - (kill-line 2) + (search-forward "<title>" nil t) 1) (defun fix-dls () @@ -49,11 +44,9 @@ ) (defun fix-divs () (interactive) - (let ((top (point))) - (replace-string "<h1 " "</div> (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1</title>") (goto-char (point-min)) - (replace-regexp "\\(</\\(p\\|\\title\\)>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\3</div>\n\\3\\4") + (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)))