emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole c1ac392 05/50: Use emacs lisp for updating th


From: Stefan Monnier
Subject: [elpa] externals/hyperbole c1ac392 05/50: Use emacs lisp for updating the web repo
Date: Wed, 17 Mar 2021 18:44:12 -0400 (EDT)

branch: externals/hyperbole
commit c1ac3923d48493b04d12df750a291efc3d5668ec
Author: Mats Lidell <matsl@gnu.org>
Commit: Mats Lidell <matsl@gnu.org>

    Use emacs lisp for updating the web repo
---
 hypb-maintenance.el | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)

diff --git a/hypb-maintenance.el b/hypb-maintenance.el
new file mode 100644
index 0000000..21953e8
--- /dev/null
+++ b/hypb-maintenance.el
@@ -0,0 +1,85 @@
+;;; hypb-maintenance.el --- functions for maintenance tasks  -*- 
lexical-binding: t; -*-
+;;
+;; Copyright (C) 1991-2021  Free Software Foundation, Inc.
+;; See the "HY-COPY" file for license information.
+;;
+;; This file is part of GNU Hyperbole.
+
+;;; Commentary:
+
+;;; Code:
+(require 'kexport)
+(require 'kimport)
+
+(defvar hypb:web-repo-location "../hyperbole-web/"
+  "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
+  (copy-file "DEMO" hypb:web-repo-location t)
+  (copy-file "DEMO-ROLO.otl" hypb:web-repo-location t)
+
+  ;; 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
+  (let ((export-buffer (make-temp-name "export")))
+    (kimport:star-outline "DEMO" export-buffer)
+    (kexport:html export-buffer (concat hypb:web-repo-location "DEMO.html") 
nil)
+    (with-current-buffer export-buffer
+      (set-buffer-modified-p nil)
+      (kill-buffer)))
+
+  ;; koutline-example.html
+  (kexport:html "kotl/EXAMPLE.kotl" (concat hypb:web-repo-location 
"koutline-example.html") nil)
+  
+  ;; HY-WHY.html
+  (kexport:html "HY-WHY.kotl" (concat hypb:web-repo-location "HY-WHY.html") 
nil)
+  )
+
+(provide 'hypb-maintenance)
+;;; hypb-maintenance.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]