comparison 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
comparison
equal deleted inserted replaced
494:7341dbbeaf28 495:b3cffcadc1c2
1 ;;; sed 's/^ *//' notes.txt|/c/Program\ Files/Pandoc/pandoc --metadata title="MHMC 2024-07-02" -s -f markdown -t html4 > notes.html
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>"))
6
7 (defun fix-html ()
8 (interactive)
9 (goto-char (point-min))
10 (forward-line 2)
11 (sgml-forward-element)
12 (forward-char 1)
13 (kill-region (point-min) (point))
14 (fix-divs)
15 (goto-char (point-min))
16 (fix-dls)
17 (goto-char (point-min))
18 (insert-file "/home/ht/Documents/RSoF/MHMC/doc-head.ent")
19 (goto-char (point-max))
20 (forward-line -2)
21 (beginning-of-line)
22 (insert "</div>\n")
23 (forward-line 1)
24 (beginning-of-line)
25 (kill-line)
26 (insert "</doc>")
27 (goto-char (point-min))
28 (search-forward "<title>" nil t)
29 )
30
31 (defun fix-dls ()
32 (interactive)
33 (replace-string "dl>" "list>")
34 (goto-char (point-min))
35 (replace-regexp "<dt>\\([^<]*\\)</dt>\n" "<item term='\\1'>")
36 (goto-char (point-min))
37 (replace-string "<dd>\n" "")
38 (goto-char (point-min))
39 (replace-string "</dd>" "</item>")
40 )
41 (defun fix-divs ()
42 (interactive)
43 (replace-regexp "^<h.[^>]*>\\([^<]*\\)</h.>" "<div>\n <title>\\1</title>")
44 (goto-char (point-min))
45 (replace-regexp "\\(</p>\n\\)\\([ ]*\\)\\(<div\\)" "\\1\\2</div>\n\\2\\3")
46 (goto-char (point-min))
47 (replace-string "<p>ACTION: " "<p class='a'>")
48 (goto-char (point-min)))