diff options
| author | Chong Yidong | 2012-06-10 17:06:34 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-06-10 17:06:34 +0800 |
| commit | f08b09fcafc730b5747060b6f3e708b0be618028 (patch) | |
| tree | 42ec1fe35a0e542296675cadbf1d1f5e2f31b843 /admin/admin.el | |
| parent | 95988fcfa86170a61e488e5de3863468f50b6414 (diff) | |
| download | emacs-f08b09fcafc730b5747060b6f3e708b0be618028.tar.gz emacs-f08b09fcafc730b5747060b6f3e708b0be618028.zip | |
admin.el (make-manuals): Generate misc html manuals too.
Diffstat (limited to 'admin/admin.el')
| -rw-r--r-- | admin/admin.el | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/admin/admin.el b/admin/admin.el index 27b2b3ab648..9fcc5795d21 100644 --- a/admin/admin.el +++ b/admin/admin.el | |||
| @@ -240,7 +240,7 @@ Root must be the root of an Emacs source tree." | |||
| 240 | (manual-txt texi (expand-file-name "emacs.txt" txt-dir)) | 240 | (manual-txt texi (expand-file-name "emacs.txt" txt-dir)) |
| 241 | (manual-pdf texi (expand-file-name "emacs.pdf" dest)) | 241 | (manual-pdf texi (expand-file-name "emacs.pdf" dest)) |
| 242 | (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir) | 242 | (manual-dvi texi (expand-file-name "emacs.dvi" dvi-dir) |
| 243 | (expand-file-name "emacs.ps" ps-dir))) | 243 | (expand-file-name "emacs.ps" ps-dir))) |
| 244 | ;; Lisp manual | 244 | ;; Lisp manual |
| 245 | (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) | 245 | (let ((texi (expand-file-name "doc/lispref/elisp.texi" root))) |
| 246 | (manual-html-node texi (expand-file-name "elisp" html-node-dir)) | 246 | (manual-html-node texi (expand-file-name "elisp" html-node-dir)) |
| @@ -248,7 +248,20 @@ Root must be the root of an Emacs source tree." | |||
| 248 | (manual-txt texi (expand-file-name "elisp.txt" txt-dir)) | 248 | (manual-txt texi (expand-file-name "elisp.txt" txt-dir)) |
| 249 | (manual-pdf texi (expand-file-name "elisp.pdf" dest)) | 249 | (manual-pdf texi (expand-file-name "elisp.pdf" dest)) |
| 250 | (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir) | 250 | (manual-dvi texi (expand-file-name "elisp.dvi" dvi-dir) |
| 251 | (expand-file-name "elisp.ps" ps-dir))) | 251 | (expand-file-name "elisp.ps" ps-dir))) |
| 252 | ;; Misc manuals | ||
| 253 | (let ((manuals '("ada-mode" "auth" "autotype" "calc" "cc-mode" | ||
| 254 | "cl" "dbus" "dired-x" "ebrowse" "ede" "ediff" | ||
| 255 | "edt" "eieio" "emacs-mime" "epa" "erc" "ert" | ||
| 256 | "eshell" "eudc" "faq" "flymake" "forms" | ||
| 257 | "gnus" "emacs-gnutls" "idlwave" "info" | ||
| 258 | "mairix-el" "message" "mh-e" "newsticker" | ||
| 259 | "nxml-mode" "org" "pcl-cvs" "pgg" "rcirc" | ||
| 260 | "remember" "reftex" "sasl" "sc" "semantic" | ||
| 261 | "ses" "sieve" "smtpmail" "speedbar" "tramp" | ||
| 262 | "url" "vip" "viper" "widget" "woman"))) | ||
| 263 | (dolist (manual manuals) | ||
| 264 | (manual-misc-html manual root html-node-dir html-mono-dir))) | ||
| 252 | (message "Manuals created in %s" dest))) | 265 | (message "Manuals created in %s" dest))) |
| 253 | 266 | ||
| 254 | (defconst manual-doctype-string | 267 | (defconst manual-doctype-string |
| @@ -265,6 +278,12 @@ Root must be the root of an Emacs source tree." | |||
| 265 | (defconst manual-style-string "<style type=\"text/css\"> | 278 | (defconst manual-style-string "<style type=\"text/css\"> |
| 266 | @import url('/style.css');\n</style>\n") | 279 | @import url('/style.css');\n</style>\n") |
| 267 | 280 | ||
| 281 | (defun manual-misc-html (name root html-node-dir html-mono-dir) | ||
| 282 | (let ((texi (expand-file-name (format "doc/misc/%s.texi" name) root))) | ||
| 283 | (manual-html-node texi (expand-file-name name html-node-dir)) | ||
| 284 | (manual-html-mono texi (expand-file-name (concat name ".html") | ||
| 285 | html-mono-dir)))) | ||
| 286 | |||
| 268 | (defun manual-html-mono (texi-file dest) | 287 | (defun manual-html-mono (texi-file dest) |
| 269 | "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST. | 288 | "Run Makeinfo on TEXI-FILE, emitting mono HTML output to DEST. |
| 270 | This function also edits the HTML files so that they validate as | 289 | This function also edits the HTML files so that they validate as |
| @@ -307,13 +326,15 @@ the @import directive." | |||
| 307 | (let (copyright-text) | 326 | (let (copyright-text) |
| 308 | (manual-html-fix-index-1) | 327 | (manual-html-fix-index-1) |
| 309 | ;; Move copyright notice to the end. | 328 | ;; Move copyright notice to the end. |
| 310 | (re-search-forward "[ \t]*<p>Copyright ©") | 329 | (when (re-search-forward "[ \t]*<p>Copyright ©" nil t) |
| 311 | (setq opoint (match-beginning 0)) | 330 | (setq opoint (match-beginning 0)) |
| 312 | (re-search-forward "</blockquote>") | 331 | (re-search-forward "</blockquote>") |
| 313 | (setq copyright-text (buffer-substring opoint (point))) | 332 | (setq copyright-text (buffer-substring opoint (point))) |
| 314 | (delete-region opoint (point)) | 333 | (delete-region opoint (point))) |
| 315 | (manual-html-fix-index-2) | 334 | (manual-html-fix-index-2) |
| 316 | (insert copyright-text "\n</div>\n")) | 335 | (if copyright-text |
| 336 | (insert copyright-text)) | ||
| 337 | (insert "\n</div>\n")) | ||
| 317 | ;; For normal nodes, give the header div a blue bg. | 338 | ;; For normal nodes, give the header div a blue bg. |
| 318 | (manual-html-fix-node-div)) | 339 | (manual-html-fix-node-div)) |
| 319 | (save-buffer)))))) | 340 | (save-buffer)))))) |
| @@ -369,9 +390,9 @@ Also generate PostScript output in PS-DEST." | |||
| 369 | 390 | ||
| 370 | (defun manual-html-fix-index-1 () | 391 | (defun manual-html-fix-index-1 () |
| 371 | (let (opoint) | 392 | (let (opoint) |
| 372 | (re-search-forward "<body>\n\\(<h1 class=\"settitle\\)") | 393 | (re-search-forward "<body>\n") |
| 373 | (setq opoint (match-beginning 1)) | 394 | (setq opoint (match-end 0)) |
| 374 | (search-forward "<h2 class=\"unnumbered") | 395 | (search-forward "<h2 class=\"") |
| 375 | (goto-char (match-beginning 0)) | 396 | (goto-char (match-beginning 0)) |
| 376 | (delete-region opoint (point)) | 397 | (delete-region opoint (point)) |
| 377 | (insert "<div id=\"content\" class=\"inner\">\n\n"))) | 398 | (insert "<div id=\"content\" class=\"inner\">\n\n"))) |
| @@ -380,7 +401,8 @@ Also generate PostScript output in PS-DEST." | |||
| 380 | "Replace the index list in the current buffer with a HTML table." | 401 | "Replace the index list in the current buffer with a HTML table." |
| 381 | (let (done open-td tag desc) | 402 | (let (done open-td tag desc) |
| 382 | ;; Convert the list that Makeinfo made into a table. | 403 | ;; Convert the list that Makeinfo made into a table. |
| 383 | (search-forward "<ul class=\"menu\">") | 404 | (or (search-forward "<ul class=\"menu\">" nil t) |
| 405 | (search-forward "<ul>")) | ||
| 384 | (replace-match "<table style=\"float:left\" width=\"100%\">") | 406 | (replace-match "<table style=\"float:left\" width=\"100%\">") |
| 385 | (forward-line 1) | 407 | (forward-line 1) |
| 386 | (while (not done) | 408 | (while (not done) |
| @@ -413,7 +435,7 @@ Also generate PostScript output in PS-DEST." | |||
| 413 | (replace-match " </td></tr></table>\n | 435 | (replace-match " </td></tr></table>\n |
| 414 | <h3>Detailed Node Listing</h3>\n\n" t t) | 436 | <h3>Detailed Node Listing</h3>\n\n" t t) |
| 415 | (search-forward "<p>") | 437 | (search-forward "<p>") |
| 416 | (search-forward "<p>") | 438 | (search-forward "<p>" nil t) |
| 417 | (goto-char (match-beginning 0)) | 439 | (goto-char (match-beginning 0)) |
| 418 | (skip-chars-backward "\n ") | 440 | (skip-chars-backward "\n ") |
| 419 | (setq open-td nil) | 441 | (setq open-td nil) |
| @@ -427,8 +449,8 @@ Also generate PostScript output in PS-DEST." | |||
| 427 | (setq open-td nil)) | 449 | (setq open-td nil)) |
| 428 | (insert " <tr> | 450 | (insert " <tr> |
| 429 | <th colspan=\"2\" align=\"left\" style=\"text-align:left\">") | 451 | <th colspan=\"2\" align=\"left\" style=\"text-align:left\">") |
| 430 | (re-search-forward "</p>[ \t\n]*<ul class=\"menu\">") | 452 | (if (re-search-forward "</p>[ \t\n]*<ul class=\"menu\">" nil t) |
| 431 | (replace-match " </th></tr>")) | 453 | (replace-match " </th></tr>"))) |
| 432 | ((looking-at "[ \t]*</ul>[ \t]*$") | 454 | ((looking-at "[ \t]*</ul>[ \t]*$") |
| 433 | (replace-match | 455 | (replace-match |
| 434 | (if open-td | 456 | (if open-td |