;ELC
;;; Compiled
;;; in Emacs version 27.1
;;; with all optimizations.
;;; This file contains utf-8 non-ASCII characters,
;;; and so cannot be loaded into Emacs 22 or earlier.
(and (boundp 'emacs-version)
(< (aref emacs-version (1- (length emacs-version))) ?A)
(string-lessp emacs-version "23")
(error "`%s' was compiled for Emacs 23 or later" #$))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\207" [require faces custom font-lock cus-edit htmlfontify-loaddefs] 2)
(defconst htmlfontify-version 0.21)
#@57 The generator meta tag for this version of htmlfontify.
(defconst hfy-meta-tags (format "" emacs-version htmlfontify-version) (#$ . 589))
#@1774 Copy and convert buffers and files to HTML, adding hyperlinks between files
(driven by etags) if requested.
Interactive functions:
`htmlfontify-buffer'
`htmlfontify-run-etags'
`htmlfontify-copy-and-link-dir'
`htmlfontify-load-rgb-file'
`htmlfontify-unload-rgb-file'
In order to:
fontify a file you have open: \[htmlfontify-buffer]
prepare the etags map for a directory: \[htmlfontify-run-etags]
copy a directory, fontifying as you go: \[htmlfontify-copy-and-link-dir]
The following might be useful when running non-windowed or in batch mode:
(note that they shouldn't be necessary - we have a built in map)
load an X11 style rgb.txt file: \[htmlfontify-load-rgb-file]
unload the current rgb.txt file: \[htmlfontify-unload-rgb-file]
And here's a programmatic example:
(defun rtfm-build-page-header (file style)
(format "#define TEMPLATE red+black.html
#define DEBUG 1
#include \n
html-css-url := /css/red+black.css
title := rtfm.etla.org ( %s / src/%s )
bodytag :=
head <=STYLESHEET;\n
%s
STYLESHEET
main-title := rtfm / %s / src/%s\n
main-content <=MAIN_CONTENT;\n" rtfm-section file style rtfm-section file))
(defun rtfm-build-page-footer (file) "\nMAIN_CONTENT\n")
(defun rtfm-build-source-docs (section srcdir destdir)
(interactive
"s section[eg- emacs / p4-blame]:\nD source-dir: \nD output-dir: ")
(require \='htmlfontify)
(hfy-load-tags-cache srcdir)
(let ((hfy-page-header \='rtfm-build-page-header)
(hfy-page-footer \='rtfm-build-page-footer)
(rtfm-section section)
(hfy-index-file "index"))
(htmlfontify-run-etags srcdir)
(htmlfontify-copy-and-link-dir srcdir destdir ".src" ".html")))
(defconst htmlfontify-manual "Htmlfontify Manual" (#$ . 802))
(byte-code "\300\301\302\303\304\305\306\307\306\310\306\311\312\313&
\210\314\315\316\317\320DD\321\304\301\322\323\324\325& \210\314\326\316\317\327DD\330\304\301\322\331\324\332& \210\314\333\316\317\334DD\335\304\301\322\336\324\337& \210\314\340\316\317\341DD\342\304\301\322\343\324\344& \210\314\345\316\317\346DD\347\304\301\322\350\324\351& \210\314\352\316\317\353DD\354\304\301\322\355\324\356& \210\314\357\316\317\360DD\361\304\301\322\362\324\363& \210\314\364\316\317\365DD\366\304\301\322\367\324\370& \210\314\371\316\317\372DD\373\304\301\322\374\324\375& \210\314\376\316\317\377DD\201@ \304\301\322\201A \324\201B & \210\314\201C \316\317\201D DD\201E \304\301\322\201F \324\201G & \210\201H \201I \201J \302#\210\201K \211\203\211@\201I N\203\201J N\204\201L \201J \201I N#\210A\266\202\202\353 \210\201M \201I \201J \201N #\210\314\201J \316\317\201O DD\201P \304\301\322\201Q \324\201R & \210\201H \201S \201T \302#\210\201K \211\203z\211@\201S N\203s\201T N\204s\201L \201T \201S N#\210A\266\202\202O\210\201M \201S \201T \201U #\210\314\201T \316\317\201V DD\201W \304\301\322\201X \201Y \201Z \324\201[ &\210\314\201\\ \316\317\201] DD\201^ \304\301\322\201_ \324\201` & \210\314\201a \316\317\201b DD\201c \304\301\322\201d \324\201e & \210\314\201f \316\317\201g DD\201h \304\301\322\201i \324\201j & \207" [custom-declare-group htmlfontify nil "Convert buffers and files to HTML." :group applications :link (variable-link htmlfontify-manual) (custom-manual "(htmlfontify) Top") (info-link "(htmlfontify) Customization") :prefix "hfy-" custom-declare-variable hfy-page-header funcall function #[0 "\300\207" [hfy-default-header] 1] "Function called to build the header of the HTML source.\nThis is called with two arguments (the filename relative to the top\nlevel source directory being etag'd and fontified), and a string containing\nthe text to embed in the document.\nIt should return a string that will be used as the header for the\nhtmlfontified version of the source file.\n\nSee also `hfy-page-footer'." :tag "page-header" :type (function) hfy-split-index #[0 "\300\207" [nil] 1] "Whether or not to split the index `hfy-index-file' alphabetically.\nIf non-nil, the index is split on the first letter of each tag.\nUseful when the index would otherwise be large and take\na long time to render or be difficult to navigate." "split-index" (boolean) hfy-page-footer #[0 "\300\207" [hfy-default-footer] 1] "As `hfy-page-header', but generates the output footer.\nIt takes only one argument, the filename." "page-footer" (function) hfy-extn #[0 "\300\207" [#1=".html"] 1 #1#] "File extension used for output files." "extension" (string) hfy-src-doc-link-style #[0 "\300\207" [#2="text-decoration: underline;"] 1 #2#] "String to add to the `\n"] 10 (#$ . 44387)])
#@104 Mark dangerous ["<>] characters with the `hfy-quoteme' property.
See also `hfy-html-dekludge-buffer'.
(defalias 'hfy-html-enkludge-buffer #[0 "\212eb\210\301\302\303#\205 \304\305\224`\306\303$\210\202 )\207" [hfy-html-quote-regex re-search-forward nil t put-text-property 0 hfy-quoteme] 5 (#$ . 44846)])
#@79 Map CHAR-STRING to an HTML safe string (entity) if need be.
(fn CHAR-STRING)
(defalias 'hfy-html-quote #[257 "\301\"A@\206\n \211\207" [hfy-html-quote-map assoc] 4 (#$ . 45161)])
#@137 Transform all dangerous characters marked with the `hfy-quoteme' property
using `hfy-html-quote'.
See also `hfy-html-enkludge-buffer'.
(defalias 'hfy-html-dekludge-buffer #[0 "\212eb\210\301\302\303#\205 \304\305\224\306\"\203 \307\310\311\312!!!\210\202 )\207" [hfy-html-quote-regex re-search-forward nil t get-text-property 0 hfy-quoteme replace-match hfy-html-quote match-string 1] 4 (#$ . 45350)])
#@158 Bind variables according to VARLIST and eval BODY restoring buffer state.
Do not record undo information during evaluation of BODY.
(fn VARLIST &rest BODY)
(defalias 'hfy-save-buffer-state '(macro . #[385 "\300\301!\302\303\304B\305B\"\306B\307\310BBF\207" [make-symbol "modified" let* append ((buffer-modified-p)) ((buffer-undo-list t) (inhibit-read-only t) (inhibit-point-motion-hooks t) (inhibit-modification-hooks t) deactivate-mark buffer-file-name buffer-file-truename) progn unless ((restore-buffer-modified-p nil))] 9 (#$ . 45764)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put hfy-save-buffer-state lisp-indent-function 1 put edebug-form-spec let] 5)
#@77 Tag trailing whitespace with a hfy property if it is currently highlighted.
(defalias 'hfy-mark-trailing-whitespace #[0 "\205= \306\212eb\210\307 \306\211\306\211\310\211\310\311\312\310\306#\2030 \313\314\224\314\225\315\306$\210\202 \211?\2058 \316\310!.\262*\207" [show-trailing-whitespace inhibit-read-only buffer-undo-list inhibit-point-motion-hooks inhibit-modification-hooks deactivate-mark t buffer-modified-p nil re-search-forward "[ ]+$" put-text-property 0 hfy-show-trailing-whitespace restore-buffer-modified-p buffer-file-name buffer-file-truename] 7 (#$ . 46457)])
#@52 Undo the effect of `hfy-mark-trailing-whitespace'.
(defalias 'hfy-unmark-trailing-whitespace #[0 "\205( \306 \307\211\307\211\310\211\f\310
\311ed\312#\210\211?\205$ \313\310!.\262\207" [show-trailing-whitespace buffer-undo-list inhibit-read-only inhibit-point-motion-hooks inhibit-modification-hooks deactivate-mark buffer-modified-p t nil remove-text-properties (hfy-show-trailing-whitespace nil) restore-buffer-modified-p buffer-file-name buffer-file-truename] 6 (#$ . 47057)])
#@179 Default handler to begin a span of text.
Insert "".
See `hfy-begin-span-handler' for more information.
(fn STYLE TEXT-BLOCK TEXT-ID TEXT-BEGINS-BLOCK-P)
(defalias 'hfy-begin-span #[1028 "\211\203\n \300\301\"c\210\203 \300\302$\202 \300\303\"c\207" [format "…" "" ""] 9 (#$ . 47555)])
#@108 Default handler to end a span of text.
Insert "". See `hfy-end-span-handler' for more
information.
(defalias 'hfy-end-span #[0 "\300c\207" [""] 1 (#$ . 47978)])
#@1081 Handler to begin a span of text.
The signature of the handler is (lambda (STYLE TEXT-BLOCK
TEXT-ID TEXT-BEGINS-BLOCK-P) ...). The handler must insert
appropriate tags to begin a span of text.
STYLE is the name of the style that begins at point. It is
derived from the face attributes as part of `hfy-face-to-css'
callback. The other arguments TEXT-BLOCK, TEXT-ID,
TEXT-BEGINS-BLOCK-P are non-nil only if the buffer contains
invisible text.
TEXT-BLOCK is a string that identifies a single chunk of visible
or invisible text of which the current position is a part. For
visible portions, its value is "nil". For invisible portions,
its value is computed as part of `hfy-invisible-name'.
TEXT-ID marks a unique position within a block. It is set to
value of `point' at the current buffer position.
TEXT-BEGINS-BLOCK-P is a boolean and is non-nil if the current
span also begins an invisible portion of text.
An implementation can use TEXT-BLOCK, TEXT-ID,
TEXT-BEGINS-BLOCK-P to implement fold/unfold-on-mouse-click like
behavior.
The default handler is `hfy-begin-span'.
(defvar hfy-begin-span-handler 'hfy-begin-span (#$ . 48162))
#@186 Handler to end a span of text.
The signature of the handler is (lambda () ...). The handler
must insert appropriate tags to end a span of text.
The default handler is `hfy-end-span'.
(defvar hfy-end-span-handler 'hfy-end-span (#$ . 49310))
#@159 Implement the guts of `htmlfontify-buffer'.
SRCDIR, if set, is the directory being htmlfontified.
FILE, if set, is the file name.
(fn &optional SRCDIR FILE)
(defalias 'hfy-fontify-buffer #[512 "\203 \306!\262\307\310 \311\211\211\211 \205 \312 \205 \313 \203C \n\203C eU\2031 \211dU\204C \314\"\262\315\316\317#\210\315\320\321#\210\322 \210\323 \262\324 \262\325 \262\326 \210\203] \327!\210\330ed#\210q\210\331ed#\210\311\203\210 \203\210 \332 \"\210\333 \"\210\334 \210\211\203\211@\211@A\311b\210\335\336\"\206\245 \335\337\"\262\340=\203\263
\210\202\f
\203\320 \f\203\320 \211\203\320 \341``T\342#\210\343\211T\337\307$\210@\344
\"\n\205\345 \345\346\347\"\"\205\353 \f\205\365
\236$\210\211\203\f\341``T\350#\203\f\343\211T\337\307$\210\266A\266\202\202\214 \210\203\234\203\234\351e\311\211\352\353\"\211\262\203K\335\353\"\211\262\203$b\210\341\211T\354#\210\355\356Qc\210\202$e\262\352\"\211\262\203\232\335\"\211\262\203Nb\210\341\211T\311D#\210\357\267\202N\335\360\"\211\262\203\205\345\361\"c\210\345\362\"c\210\337\262\202N\363c\210\351\262\202N\266\364 \210\365\366!\204\322eb\210\367 \"c\210\365\370!\203\271\371c\210\372c\210db\210\373c\210\365\370!\203\313\374c\210A!c\210\375\376!\210\377\311!\210)\207" [inhibit-read-only mark-active transient-mark-mode hfy-ignored-properties buffer-invisibility-spec hfy-end-span-handler directory-file-name t hfy-buffer nil region-beginning region-end make-overlay overlay-put priority 1000 face region hfy-mark-trailing-whitespace hfy-compile-stylesheet hfy-compile-face-map hfy-find-invisible-ranges hfy-unmark-trailing-whitespace delete-overlay copy-to-buffer remove-list-of-text-properties hfy-mark-tag-names hfy-mark-tag-hrefs hfy-html-enkludge-buffer get-text-property hfy-linkp hfy-endl end remove-text-properties (hfy-endl nil) put-text-property hfy-lookup format "%s" hfy-invisible-name (hfy-endl nil) hfy-link next-single-property-change hfy-anchor (hfy-anchor nil) "" #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (hfy-link 373 hfy-endl 401)) hfy-inst "" "" "" hfy-html-dekludge-buffer hfy-opt body-text-only hfy-sprintf-stylesheet div-wrapper "" run-hooks hfy-post-html-hook set-buffer-modified-p hfy-begin-span-handler hfy-page-footer] 21 (#$ . 49559)])
#@210 Take a STRING and return a fontified version of it.
It is assumed that STRING has text properties that allow it to be
fontified. This is a simple convenience wrapper around
`htmlfontify-buffer'.
(fn STRING)
(defalias 'htmlfontify-string #[257 "\301!\302>\203
\211\202 \302B\211\262\303\304!r\211q\210\305\306\307\310\311!\312\"\313$\216c\210\314 \210\315 *\262)\207" [hfy-optimizations copy-sequence skip-refontification generate-new-buffer " *temp*" make-byte-code 0 "\301\300!\205 \302\300!\207" vconcat vector [buffer-name kill-buffer] 2 htmlfontify-buffer buffer-string] 9 (#$ . 52065)])
#@59 Try to force font-locking even when it is optimized away.
(defalias 'hfy-force-fontification #[0 "\306\307!\210\310\311!\210\312\300!\203 \204 \313 \2035 \314\315\316 \206\" \317 \n#\210\320\321!\203. \321 \207\2054 \322 \207\320\323!\203N \312\304!\203N \f\203N \314\324
\n#\210\323 \207\314\325
\n#\207" [font-lock-cache-position noninteractive major-mode font-lock-defaults jit-lock-mode window-system run-hooks hfy-init-kludge-hook require font-lock boundp make-marker message "hfy batch mode (%s:%S)" buffer-file-name buffer-name fboundp font-lock-ensure font-lock-fontify-buffer jit-lock-fontify-now "hfy jit-lock mode (%S %S)" "hfy interactive mode (%S %S)"] 4 (#$ . 52676)])
#@693 Create a new buffer, named for the current buffer + a .html extension,
containing an inline CSS-stylesheet and formatted CSS-markup HTML
that reproduces the look of the current Emacs buffer as closely
as possible.
Dangerous characters in the existing buffer are turned into HTML
entities, so you should even be able to do HTML-within-HTML
fontified display.
You should, however, note that random control or non-ASCII
characters such as ^L (U+000C FORM FEED (FF)) or ¤ (U+00A4
CURRENCY SIGN) won't get mapped yet.
If the SRCDIR and FILE arguments are set, lookup etags derived
entries in the `hfy-tags-cache' and add HTML anchors and
hyperlinks as appropriate.
(fn &optional SRCDIR FILE)
(defalias 'htmlfontify-buffer #[512 "\211\204 \300 \206 \301 \262\302\303\"\203 \304\305\"\262\306\307!\204% \212\310 \210)\311\312!\2032 \313\314\"!\207\314\"\207" [buffer-file-name buffer-name string-match "/\\([^/]*\\)\\'" match-string 1 hfy-opt skip-refontification hfy-force-fontification called-interactively-p any switch-to-buffer hfy-fontify-buffer] 6 (#$ . 53372) nil])
#@101 Return a list of files under DIRECTORY.
Strips any leading "./" from each filename.
(fn DIRECTORY)
(defalias 'hfy-list-files #[257 "\301!\210\302\303\304\305!!\"\207" [hfy-find-cmd cd mapcar #[257 "\300\301\"\203\f \302\303\"\207\207" [string-match "^./\\(.*\\)" match-string 1] 4 "\n\n(fn F)"] split-string shell-command-to-string] 6 (#$ . 54461)])
#@228 Return everything preceding the last "/" from a relative filename FILE,
on the assumption that this will produce a relative directory name.
Hardly bombproof, but good enough in the context in which it is being used.
(fn FILE)
(defalias 'hfy-dirname #[257 "\300!\301\302\"\205 \303\304\"\207" [directory-file-name string-match "^\\(.*\\)/" match-string 1] 5 (#$ . 54823)])
#@47 Approx. equivalent of mkdir -p DIR.
(fn DIR)
(defalias 'hfy-make-directory #[257 "\300!\203 \301!\205 \302\207\303\302\"\207" [file-exists-p file-directory-p t make-directory] 4 (#$ . 55206)])
#@86 Is SRCDIR/FILE text? Uses `hfy-istext-command' to determine this.
(fn SRCDIR FILE)
(defalias 'hfy-text-p #[514 "\301\302\303\"!\"\304!\305\306\"\207" [hfy-istext-command format shell-quote-argument expand-file-name shell-command-to-string string-match "text"] 8 (#$ . 55411)])
#@234 Open FILE in SRCDIR - if fontified, write a fontified copy to DSTDIR
adding an extension of `hfy-extn'. Fontification is actually done by
`htmlfontify-buffer'. If the buffer is not fontified, just copy it.
(fn SRCDIR DSTDIR FILE)
(defalias 'hfy-copy-and-fontify-file #[771 "\301\211\211\302!\210r\303!\211\262q\210\304Q\262\305\306!!\210\307\310!\204&