comparison MHMC/minutes.el @ 533:6b7198aed717

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