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 (37)
hfy-begin-span-handler | Handler to begin a span of text. |
hfy-default-face-def | Fallback ‘defface’ specification for the face ‘default’, used when |
hfy-display-class | Display class to use to determine which display class to use when |
hfy-end-span-handler | Handler to end a span of text. |
hfy-etag-regex | Regex used to parse an etags entry. |
hfy-etags-bin | Location of etags binary (we begin by assuming it’s in your path). |
hfy-etags-cmd | The etags equivalent command to run in a source directory to generate a tags |
hfy-etags-cmd-alist | Alist of possible shell commands that will generate etags output that |
hfy-exclude-file-rules | Regular expressions matching files to exclude. |
hfy-extn | File extension used for output files. |
hfy-face-to-css | Handler for mapping faces to styles. |
hfy-facemap-assoc | An assoc of (point . FACE-SYMBOL) or (point . DEFFACE-LIST) |
hfy-font-zoom | Font scaling from Emacs to HTML. |
hfy-html-quote-map | Alist of char -> entity mappings used to make the text HTML-safe. |
hfy-html-quote-regex | Regex to match (with a single back-reference per match) strings in HTML |
hfy-ignored-properties | Properties to omit when copying a fontified buffer for HTML transformation. |
hfy-index-file | Name (sans extension) of the tag definition index file produced during |
hfy-instance-file | Name (sans extension) of the tag usage index file produced during |
hfy-istext-command | Command to run with the name of a file, to see if it is a text file or not. |
hfy-link-extn | File extension used for href links. |
hfy-link-style-fun | Function to customize the appearance of hyperlinks. |
hfy-meta-tags | The generator meta tag for this version of htmlfontify. |
hfy-optimizations | Optimizations to turn on. |
hfy-page-footer | As ‘hfy-page-header’, but generates the output footer. |
hfy-page-header | Function called to build the header of the HTML source. |
hfy-post-html-hook | List of functions to call after creating and filling the HTML buffer. |
hfy-sheet-assoc | An assoc with elements of the form (face-name style-name . style-string): |
hfy-shell-file-name | Shell (Bourne or compatible) to invoke for complex shell operations. |
hfy-split-index | Whether or not to split the index ‘hfy-index-file’ alphabetically. |
hfy-src-doc-link-style | String to add to the ‘<style> a’ variant of an htmlfontify CSS class. |
hfy-src-doc-link-unstyle | Regex to remove from the ‘<style> a’ variant of an htmlfontify CSS class. |
hfy-style-assoc | An assoc representing/describing an Emacs face. |
hfy-tags-cache | Alist of the form: |
hfy-tags-rmap | Alist of the form (("/src/dir" . tag-rmap-hash)) |
hfy-tags-sortl | Alist of the form (("/src/dir" . (tag0 tag1 tag2)) ... ) |
hfy-tmpfont-stack | An alist of derived fonts resulting from overlays. |
htmlfontify-manual | Copy and convert buffers and files to HTML. |