annotate MHMC/minutes.el @ 542:53a504a7c31b

with results
author Henry Thompson <ht@markup.co.uk>
date Wed, 18 Sep 2024 09:33:55 +0100
parents 6b7198aed717
children 5def9134830d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
533
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
1 ;;; /c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -N -f markdown -t html4 > notes.html
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
2 ;;; Use -s if you want to just see the pandoc html as such, e.g. for an agenda to be emailed verbatim
495
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
3
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
4 (defun fix-html ()
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
5 (interactive)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
6 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
7 (forward-line 2)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
8 (sgml-forward-element)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
9 (forward-char 1)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
10 (kill-region (point-min) (point))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
11 (fix-dls)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
12 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
13 (insert-file "/home/ht/Documents/RSoF/MHMC/doc-head.ent")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
14 (goto-char (point-max))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
15 (forward-line -2)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
16 (beginning-of-line)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
17 (insert "</div>\n")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
18 (forward-line 1)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
19 (beginning-of-line)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
20 (kill-line)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
21 (insert "</doc>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
22 (goto-char (point-min))
496
34129b221ffa _ for italic, ** or __ for bold
Henry Thompson <ht@markup.co.uk>
parents: 495
diff changeset
23 (replace-string "em>" "emph>")
34129b221ffa _ for italic, ** or __ for bold
Henry Thompson <ht@markup.co.uk>
parents: 495
diff changeset
24 (goto-char (point-min))
34129b221ffa _ for italic, ** or __ for bold
Henry Thompson <ht@markup.co.uk>
parents: 495
diff changeset
25 (replace-string "strong>" "name>")
34129b221ffa _ for italic, ** or __ for bold
Henry Thompson <ht@markup.co.uk>
parents: 495
diff changeset
26 (goto-char (point-min))
533
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
27 (let* ((hb (search-forward "<title>" nil t))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
28 (tb (search-forward "<title>" nil t))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
29 (te (- (search-forward "</title>") 8))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
30 (tt (buffer-substring tb te)))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
31 (goto-char hb)
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
32 (insert tt))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
33 (search-forward "<div id=\"header\"" nil t)
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
34 (beginning-of-line)
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
35 (kill-line)
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
36 (forward-line 2)
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
37 (kill-line 2)
496
34129b221ffa _ for italic, ** or __ for bold
Henry Thompson <ht@markup.co.uk>
parents: 495
diff changeset
38 1)
495
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
39
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
40 (defun fix-dls ()
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
41 (interactive)
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
42 (replace-string "dl>" "list>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
43 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
44 (replace-regexp "<dt>\\([^<]*\\)</dt>\n" "<item term='\\1'>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
45 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
46 (replace-string "<dd>\n" "")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
47 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
48 (replace-string "</dd>" "</item>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
49 )
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
50 (defun fix-divs ()
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
51 (interactive)
533
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
52 (let ((top (point)))
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
53 (replace-string "<h1 " "</div>
495
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
54 (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1</title>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
55 (goto-char (point-min))
533
Henry Thompson <ht@markup.co.uk>
parents: 496
diff changeset
56 (replace-regexp "\\(</\\(p\\|\\title\\)>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\3</div>\n\\3\\4")
495
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
57 (goto-char (point-min))
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
58 (replace-string "<p>ACTION: " "<p class='a'>")
b3cffcadc1c2 for fixup of pandoc output
Henry Thompson <ht@markup.co.uk>
parents:
diff changeset
59 (goto-char (point-min)))