comparison MHMC/minutes.el @ 621:e02ed600230c

merge
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 29 Apr 2025 15:47:02 +0100
parents 5def9134830d
children
comparison
equal deleted inserted replaced
620:a9577984cdfc 621:e02ed600230c
1 ;;; /c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -N -f markdown -t html4 > notes.html 1 ;;; sed 's/^ *//' notes.txt|/c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -s -f markdown -t html4 > notes.html
2 ;;; Use -s if you want to just see the pandoc html as such, e.g. for an agenda to be emailed verbatim 2
3 ;;; from before pandoc
4 (defalias 'format-action (read-kbd-macro
5 "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>"))
3 6
4 (defun fix-html () 7 (defun fix-html ()
5 (interactive) 8 (interactive)
6 (goto-char (point-min)) 9 (goto-char (point-min))
7 (forward-line 2) 10 (forward-line 2)
8 (sgml-forward-element) 11 (sgml-forward-element)
9 (forward-char 1) 12 (forward-char 1)
10 (kill-region (point-min) (point)) 13 (kill-region (point-min) (point))
14 (fix-divs)
15 (goto-char (point-min))
11 (fix-dls) 16 (fix-dls)
12 (goto-char (point-min)) 17 (goto-char (point-min))
13 (insert-file "/home/ht/Documents/RSoF/MHMC/doc-head.ent") 18 (insert-file "/home/ht/Documents/RSoF/MHMC/doc-head.ent")
14 (goto-char (point-max)) 19 (goto-char (point-max))
15 (forward-line -2) 20 (forward-line -2)
22 (goto-char (point-min)) 27 (goto-char (point-min))
23 (replace-string "em>" "emph>") 28 (replace-string "em>" "emph>")
24 (goto-char (point-min)) 29 (goto-char (point-min))
25 (replace-string "strong>" "name>") 30 (replace-string "strong>" "name>")
26 (goto-char (point-min)) 31 (goto-char (point-min))
27 (let* ((hb (search-forward "<title>" nil t)) 32 (search-forward "<title>" nil t)
28 (tb (search-forward "<title>" nil t))
29 (te (- (search-forward "</title>") 8))
30 (tt (buffer-substring tb te)))
31 (goto-char hb)
32 (insert tt))
33 (search-forward "<div id=\"header\"" nil t)
34 (beginning-of-line)
35 (kill-line)
36 (forward-line 2)
37 (kill-line 2)
38 1) 33 1)
39 34
40 (defun fix-dls () 35 (defun fix-dls ()
41 (interactive) 36 (interactive)
42 (replace-string "dl>" "list>") 37 (replace-string "dl>" "list>")
47 (goto-char (point-min)) 42 (goto-char (point-min))
48 (replace-string "</dd>" "</item>") 43 (replace-string "</dd>" "</item>")
49 ) 44 )
50 (defun fix-divs () 45 (defun fix-divs ()
51 (interactive) 46 (interactive)
52 (let ((top (point)))
53 (replace-string "<h1 " "</div>
54 (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1</title>") 47 (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1</title>")
55 (goto-char (point-min)) 48 (goto-char (point-min))
56 (replace-regexp "\\(</\\(p\\|\\title\\)>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\3</div>\n\\3\\4") 49 (replace-regexp "\\(</p>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\2</div>\n\\2\\3")
57 (goto-char (point-min)) 50 (goto-char (point-min))
58 (replace-string "<p>ACTION: " "<p class='a'>") 51 (replace-string "<p>ACTION: " "<p class='a'>")
59 (goto-char (point-min))) 52 (goto-char (point-min)))