File: htmlfontify.el.html

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
I have made some changes to make it work for Emacs 22. A lot of
small bug fixes related to the format of text and overlay properties (which might have changed since the beginning of 2003 when this file was originally written).

The function hfy-face-at currently carries much of the burden of my lacking understanding of the formats mentioned above and should need some knowledgeable help.

Another thing that maybe could be fixed is that overlay background colors which are now only seen where there is text (in the XHTML output). A bit of CSS tweaking is necessary there.

The face 'default has a value :background "SystemWindow" for the
background color. There is no explicit notion that this should be
considered transparent, but I have assumed that it could be handled like if it was here. (I am unsure that background and foreground priorities are handled ok, but it looks ok in my tests now.)

2007-12-27 Lennart Borgman
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Here's some elisp code to html-pretty-print an Emacs buffer, preserving the Emacs syntax/whatever highlighting. It also knows how to drive etags
(exuberant-ctags or Emacs etags) and hyperlink the code according
to its (etags') output.

NOTE: Currently the hyperlinking code only knows how to drive GNU find and the exuberant and GNU variants of etags : I do not know of any other etags variants, but mechanisms have been provided to allow htmlfontify to be taught how to drive them. As long as your version of find has the -path test and is reasonably sane, you should be fine.

A sample of the htmlfontified / hyperlinked output of this module can be found at http://rtfm.etla.org/sql/dbishell/src/ - it's not perfect, but it's a hell of a lot faster and more thorough than I could hope to be doing this by hand.

some user / horrified onlooker comments:
What? No! There's something deeply wrong here... (R. Shufflebotham)
You're a freak. (D. Silverstone)
Aren't we giving you enough to do? (J. Busuttil)
You're almost as messed up as Lexx is! (N. Graves-Morris)

Defined variables (38)

hfy-begin-span-handlerHandler to begin a span of text.
hfy-default-face-defFallback ‘defface’ specification for the face ‘default’, used when
hfy-display-classDisplay class to use to determine which display class to use when
hfy-end-span-handlerHandler to end a span of text.
hfy-etag-regexRegex used to parse an etags entry.
hfy-etags-binLocation of etags binary (we begin by assuming it’s in your path).
hfy-etags-cmdThe etags equivalent command to run in a source directory to generate a tags
hfy-etags-cmd-alistAlist of possible shell commands that will generate etags output that
hfy-extnFile extension used for output files.
hfy-face-to-cssHandler for mapping faces to styles.
hfy-facemap-assocAn assoc of (point . FACE-SYMBOL) or (point . DEFFACE-LIST)
hfy-find-cmdFind command used to harvest a list of files to attempt to fontify.
hfy-font-zoomFont scaling from Emacs to HTML.
hfy-html-quote-mapAlist of char -> entity mappings used to make the text HTML-safe.
hfy-html-quote-regexRegex to match (with a single back-reference per match) strings in HTML
hfy-ignored-propertiesProperties to omit when copying a fontified buffer for HTML transformation.
hfy-index-fileName (sans extension) of the tag definition index file produced during
hfy-instance-fileName (sans extension) of the tag usage index file produced during
hfy-istext-commandCommand to run with the name of a file, to see if it is a text file or not.
hfy-link-extnFile extension used for href links.
hfy-link-style-funFunction to customize the appearance of hyperlinks.
hfy-meta-tagsThe generator meta tag for this version of htmlfontify.
hfy-optimizationsOptimizations to turn on.
hfy-page-footerAs ‘hfy-page-header’, but generates the output footer.
hfy-page-headerFunction called to build the header of the HTML source.
hfy-post-html-hookList of functions to call after creating and filling the HTML buffer.
hfy-post-html-hooksList of functions to call after creating and filling the HTML buffer.
hfy-sheet-assocAn assoc with elements of the form (face-name style-name . style-string):
hfy-shell-file-nameShell (Bourne or compatible) to invoke for complex shell operations.
hfy-split-indexWhether or not to split the index ‘hfy-index-file’ alphabetically.
hfy-src-doc-link-styleString to add to the ‘<style> a’ variant of an htmlfontify CSS class.
hfy-src-doc-link-unstyleRegex to remove from the ‘<style> a’ variant of an htmlfontify CSS class.
hfy-style-assocAn assoc representing/describing an Emacs face.
hfy-tags-cacheAlist of the form:
hfy-tags-rmapAlist of the form (("/src/dir" . tag-rmap-hash))
hfy-tags-sortlAlist of the form (("/src/dir" . (tag0 tag1 tag2)) ... )
hfy-tmpfont-stackAn alist of derived fonts resulting from overlays.
htmlfontify-manualCopy and convert buffers and files to HTML.

Defined functions (85)

hfy--size-to-int(SPEC)
hfy-begin-span(STYLE TEXT-BLOCK TEXT-ID TEXT-BEGINS-BLOCK-P)
hfy-bgcol(COLOR)
hfy-box(BOX)
hfy-box-to-border-assoc(SPEC)
hfy-box-to-style(SPEC)
hfy-buffer()
hfy-color(COLOR)
hfy-color-vals(COLOR)
hfy-colour(COLOR)
hfy-colour-vals(COLOR)
hfy-combined-face-spec(FACE)
hfy-compile-face-map()
hfy-compile-stylesheet()
hfy-copy-and-fontify-file(SRCDIR DSTDIR FILE)
hfy-css-name(FN)
hfy-decor(TAG VAL)
hfy-default-footer(FILE)
hfy-default-header(FILE STYLE)
hfy-dirname(FILE)
hfy-end-span()
hfy-face-at(P)
hfy-face-attr-for-class(FACE &optional CLASS)
hfy-face-or-def-to-name(FN)
hfy-face-resolve-face(FN)
hfy-face-to-css-default(FN)
hfy-face-to-style(FN)
hfy-face-to-style-i(FN)
hfy-family(FAMILY)
hfy-find-invisible-ranges()
hfy-flatten-style(STYLE)
hfy-fontified-p()
hfy-fontify-buffer(&optional SRCDIR FILE)
hfy-force-fontification(&optional BEG END)
hfy-href(THIS-FILE DEF-FILES TAG TAG-MAP)
hfy-href-stub(THIS-FILE DEF-FILES TAG)
hfy-html-dekludge-buffer()
hfy-html-enkludge-buffer()
hfy-html-quote(CHAR-STRING)
hfy-init-progn(BODY...)
hfy-initfile()
hfy-interq(SET-A SET-B)
hfy-invisible(&optional VAL)
hfy-invisible-name(POINT MAP)
hfy-kludge-cperl-mode()
hfy-link-style(STYLE-STRING)
hfy-link-style-string(STYLE-STRING)
hfy-list-files(DIRECTORY)
hfy-load-tags-cache(SRCDIR)
hfy-lookup(FACE STYLE)
hfy-make-directory(DIR)
hfy-mark-tag-hrefs(SRCDIR FILE)
hfy-mark-tag-names(SRCDIR FILE)
hfy-mark-trailing-whitespace()
hfy-merge-adjacent-spans(FACE-MAP)
hfy-opt(SYMBOL)
hfy-overlay-props-at(P)
hfy-parse-tags-buffer(SRCDIR BUFFER)
hfy-prepare-index(SRCDIR DSTDIR)
hfy-prepare-index-i(SRCDIR DSTDIR FILENAME &optional STUB MAP)
hfy-prepare-tag-map(SRCDIR DSTDIR)
hfy-prop-invisible-p(POS)
hfy-relstub(FILE &optional START)
hfy-save-buffer-state(VARLIST &rest BODY)
hfy-save-initvar(SYM)
hfy-save-kill-buffers(BUFFER-LIST &optional DSTDIR)
hfy-shell()
hfy-size(HEIGHT)
hfy-slant(SLANT)
hfy-sprintf-stylesheet(CSS FILE)
hfy-subtract-maps(SRCDIR)
hfy-tags-for-file(CACHE-HASH FILE)
hfy-text-p(SRCDIR FILE)
hfy-triplet(COLOR)
hfy-unmark-trailing-whitespace()
hfy-weight(WEIGHT)
hfy-which-etags()
hfy-width(WIDTH)
hfy-word-regex(STRING)
htmlfontify-buffer(&optional SRCDIR FILE)
htmlfontify-copy-and-link-dir(SRCDIR DSTDIR &optional F-EXT L-EXT)
htmlfontify-load-initfile()
htmlfontify-run-etags(SRCDIR)
htmlfontify-save-initfile()
htmlfontify-string(STRING)

Defined faces (0)