User: adrian
Date: 06/03/19 22:58:53
Modified: xemacs-builds/adrian/documentation texinfo-menu2html.el
Log:
safety checkpoint (needing more work to pick correct sections of info node)
Revision Changes Path
1.2 +30 -25 XEmacs/xemacs-builds/adrian/documentation/texinfo-menu2html.el
Index: texinfo-menu2html.el
===================================================================
RCS file:
/pack/xemacscvs/XEmacs/xemacs-builds/adrian/documentation/texinfo-menu2html.el,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- texinfo-menu2html.el 2004/02/14 00:02:20 1.1
+++ texinfo-menu2html.el 2006/03/19 21:58:52 1.2
@@ -1,25 +1,30 @@
-# entry = $2
-# file = $4
-# node = $5
-# descrtiption = $7
-
-On 2003-10-18 I used following query-replace-regexp to update
-xemacsweb\Documentation\packages\html\index.content
-via ediff from a buffer replacing inside a *info* buffer -- Adrian.
-
-
-^\*\ \(\([^:]+\):\s-*\)?\((\([^)]+\))\)?\([^:,. ]+\)?\([:,. ]+\(.+\(
-[ ]+.+\)*\)\)?
-
-
- <tr>
- <td valign="top" nowrap="nowrap">* \2: (<a
href="\4.html">\4</a>).</td>
- <td>\7</td>
- </tr>
-
-Improved on 2004-02-14 to this:
-(query-replace-regexp "^\\*\\
\\(\\([^:]+\\):\\s-*\\)?\\((\\([^)]+\\))\\)?\\([^:,. ]+\\)?\\([:,. ]+\\(.+\\(\n[
]+.+\\)*\\)\\)?" " <tr>\n <td valign=\"top\"
nowrap=\"nowrap\">* \\2: (<a
href=\"\\4.html\">\\4</a>).</td>\n
<td>\\7</td>\n </tr>\n" nil)
-
-The resulting records are best sorted (with sort-fold-case set t) as follows:
-
-(sort-regexp-fields nil "\n <tr>\n <td valign=\"top\"
nowrap=\"nowrap\">\\*.*<a href=.+>\\(.+\\)</a>.*</td>\n
<td>.+</td>\n </tr>\n" "\\1" (point) (point-max))
+(defun texinfo-menu2html ()
+ "Create HTML fragment for
+xemacsweb/Documentation/packages/html/index.content from info buffer."
+ (interactive)
+ (if (get-buffer "*info*")
+ (message "*info* exists, please kill buffer first")
+ (with-output-to-temp-buffer
+ "*packages html index fragment*"
+ (princ
+ (with-temp-buffer
+ (with-string-as-buffer-contents
+ (with-current-buffer
+ (or (info) "*info*")
+ (let (text)
+ (goto-char (point-min))
+ (search-forward-regexp "Other Documentation:\n")
+ (setq text (buffer-substring (point) (point-max)))
+ (kill-buffer "*info*")
+ text))
+ ;; entry = $2
+ ;; file = $4
+ ;; node = $5
+ ;; descrtiption = $7
+ (goto-char (point-min))
+ (replace-regexp "^\\*\\
\\(\\([^:]+\\):\\s-*\\)?\\((\\([^)]+\\))\\)?\\([^:,. ]+\\)?\\([:,. ]+\\(.+\\(\n[
]+.+\\)*\\)\\)?" " <tr>\n <td valign=\"top\"
nowrap=\"nowrap\">* \\2: (<a
href=\"\\4.html\">\\4</a>).</td>\n
<td>\\7</td>\n </tr>\n" nil)
+ (let ((sort-fold-case t))
+ (sort-regexp-fields nil "\n <tr>\n <td
valign=\"top\" nowrap=\"nowrap\">\\*.*<a
href=.+>\\(.+\\)</a>.*</td>\n <td>.+</td>\n
</tr>\n" "\\1" (point) (point-max)))
+ (goto-char (point-min))
+ (replace-regexp "\\([^ >]\\)\\s-*\n\\s-+\\([^ <]\\)" "\\1
\\2" nil)
+ (buffer-string)))))))
Show replies by date