forked from rswgnu/hyperbole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hypb-maintenance.el
105 lines (85 loc) · 3.19 KB
/
hypb-maintenance.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
;;; hypb-maintenance.el --- functions for maintenance tasks -*- lexical-binding: t; -*-
;;
;; Author: Mats Lidell <[email protected]>
;;
;; Orig-Date: 31-Mar-21 at 21:11:00
;; Last-Mod: 1-May-22 at 19:06:09 by Bob Weiner
;;
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
;;
;; This file is part of GNU Hyperbole.
;;; Commentary:
;;; Code:
(require 'kexport "kotl/kexport")
(require 'kimport "kotl/kimport")
(defvar hypb:web-repo-location "../hyweb/hyperbole/"
"The location of hyperbole repo for the web pages.")
(defconst hypb:hy-news-header
"<HTML><HEAD>
<A ID=\"top\"></A><A ID=\"k0\"></A>
<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"man/hyperbole.css\">
</HEAD>
<BODY BGCOLOR=\"#FFFFFF\">
<CENTER><H1>What's New in GNU Hyperbole</H1></CENTER>
<PRE>
"
"HY_NEWS html header.")
(defconst hypb:hy-news-footer
" </PRE>
</BODY></HTML>
"
"HY_NEWS html footer.")
(defun hypb:web-repo-update ()
"Update the Hyperbole web repository from sources.
Point `hypb:web-repo-location' to where the web repo is located."
(interactive)
;; HY_NEWS
(with-temp-file (concat hypb:web-repo-location "HY-NEWS.html")
(insert hypb:hy-news-header)
(insert-file-contents "HY-NEWS")
(save-excursion
(let ((beg (point)))
(search-forward "====")
(beginning-of-line)
(delete-region beg (point))))
(indent-region (point) (point-max) 3)
(goto-char (point-max))
(insert hypb:hy-news-footer))
;; hyperbole.html
(copy-file "README.md.html" (concat hypb:web-repo-location "hyperbole.html") t)
;; DEMO DEMO-ROLO.otl HY-ABOUT INSTALL HY-COPY COPYING MANIFEST
;; hui.el hbut.el hbdata.el hmail.el - referenced in hyperbole.el
(mapc (lambda (file) (copy-file file hypb:web-repo-location t))
'("DEMO" "DEMO-ROLO.otl" "FAST-DEMO" "HY-ABOUT" "INSTALL"
"HY-COPY" "COPYING" "MANIFEST"
"hui.el" "hbut.el" "hbdata.el" "hmail.el"))
;; man recursive
(copy-directory "man" hypb:web-repo-location nil t nil)
(dolist (file
(file-expand-wildcards (concat hypb:web-repo-location "man/im/*.eps")))
(delete-file file))
;; DEMO.html and FAST-DEMO.html
(dolist (file '("DEMO" "FAST-DEMO"))
(let ((export-buffer (make-temp-name "export")))
(kimport:star-outline file export-buffer)
(kexport:html export-buffer (concat hypb:web-repo-location file ".html") nil)
(with-current-buffer export-buffer
(set-buffer-modified-p nil)
(kill-buffer))))
;; koutline-example.html
(let ((example-src-name "kotl/EXAMPLE.kotl"))
(kexport:html example-src-name (concat hypb:web-repo-location "koutline-example.html") nil)
(with-current-buffer (get-file-buffer example-src-name)
(set-buffer-modified-p nil)
(kill-buffer)))
;; HY-WHY.html
(let ((hy-why-src-name "HY-WHY.kotl"))
(kexport:html hy-why-src-name (concat hypb:web-repo-location "HY-WHY.html") nil)
(with-current-buffer (get-file-buffer hy-why-src-name)
(set-buffer-modified-p nil)
(kill-buffer))
(kexport:html hy-why-src-name (concat hypb:web-repo-location "HY-WHY.html") nil))
(message "Local copy of Hyperbole website updated successfully."))
(provide 'hypb-maintenance)
;;; hypb-maintenance.el ends here