File: htmlize.el.html

This package converts the buffer text and the associated decorations to HTML.

To use it, just switch to the buffer you want HTML-ized and type M-x htmlize-buffer. You will be switched to a new buffer that contains the resulting HTML code. You can edit and inspect this buffer, or you can just save it with C-x C-w. M-x htmlize-file will find a file, fontify it, and save the HTML version in FILE.html, without any additional intervention. M-x htmlize-many-files allows you to htmlize any number of files in the same manner. M-x htmlize-many-files-dired does the same for files marked in a dired buffer.

Htmlize supports three types of HTML output, selected by setting htmlize-output-type: css, inline-css, and font. In css mode, htmlize uses cascading style sheets to specify colors; it generates classes that correspond to Emacs faces and uses <span class=FACE>...</span> to color parts of text. In this mode, the produced HTML is valid under the 4.01 strict DTD, as confirmed by the W3C validator. inline-css is like css, except the CSS is put directly in the STYLE attribute of the SPAN element, making it possible to paste the generated HTML into existing HTML documents. In font mode, htmlize uses <font color="...">...</font> to colorize HTML, which is not standard-compliant, but works better in older browsers. css mode is the default.

You can also use htmlize from your Emacs Lisp code. When called non-interactively, htmlize-buffer and htmlize-region will return the resulting HTML buffer, but will not change current buffer or move the point. Htmlize will do its best to work on non-windowing Emacs sessions but the result will be limited to colors supported by the terminal.

The latest version is available at:

       <https://github.com/emacsorphanage/htmlize>

Thanks go to the many people who have sent reports and contributed comments, suggestions, and fixes. They include Ron Gut, Bob Weiner, Toni Drabik, Peter Breton, Ville Skytta, Thomas Vogels, Juri Linkov, Maciek Pasternacki, and many others.

User quotes: "You sir, are a sick, sick, _sick_ person. :)"
                 -- Bill Perry, author of Emacs/W3

Defined variables (22)

htmlize-after-hookHook run after htmlizing a buffer.
htmlize-before-hookHook run before htmlizing a buffer.
htmlize-convert-nonascii-to-entitiesWhether non-ASCII characters should be converted to HTML entities.
htmlize-css-name-prefixThe prefix used for CSS names.
htmlize-face-overridesOverrides for face definitions.
htmlize-file-hookHook run by ‘htmlize-file’ after htmlizing a file, but before saving it.
htmlize-force-inline-imagesNon-nil means generate all images inline using data URLs.
htmlize-generate-hyperlinksNon-nil means auto-generate the links from URLs and mail addresses in buffer.
htmlize-head-tagsAdditional tags to insert within HEAD of the generated document.
htmlize-html-charsetThe charset declared by the resulting HTML documents.
htmlize-html-major-modeThe mode the newly created HTML buffer will be put in.
htmlize-hyperlink-styleThe CSS style used for hyperlinks when in CSS mode.
htmlize-ignore-face-sizeWhether face size should be ignored when generating HTML.
htmlize-image-mime-type-alistAlist mapping Emacs image types to Mime media types.
htmlize-max-alt-textMaximum size of text to use as ALT text in images.
htmlize-output-typeOutput type of generated HTML, one of ‘css’, ‘inline-css’, or ‘font’.
htmlize-pre-styleWhen non-nil, ‘<pre>’ tags will be decorated with style
htmlize-replace-form-feedsNon-nil means replace form feeds in source code with HTML separators.
htmlize-transform-imageFunction called to modify the image descriptor.
htmlize-untabifyNon-nil means untabify buffer contents during htmlization.
htmlize-use-imagesWhether htmlize generates ‘img’ for images attached to buffer contents.
htmlize-use-rgb-txtWhether ‘rgb.txt’ should be used to convert color names to RGB.

Defined functions (91)

copy-htmlize-fstruct(ARG)
htmlize-add-before-after-strings(BEG END TEXT)
htmlize-alt-text(IMGPROPS ORIGTEXT)
htmlize-attr-escape(STRING)
htmlize-attrlist-to-fstruct(ATTRLIST &optional NAME)
htmlize-buffer(&optional BUFFER INTERACTIVE)
htmlize-buffer-substring-no-invisible(BEG END)
htmlize-color-to-rgb(COLOR)
htmlize-concat(LIST)
htmlize-copy-attr-if-set(ATTR-LIST DEST SOURCE)
htmlize-copy-prop(PROP BEG END STRING)
htmlize-create-auto-links()
htmlize-css-insert-head(BUFFER-FACES FACE-MAP)
htmlize-css-specs(FSTRUCT)
htmlize-css-text-markup(FSTRUCT-LIST BUFFER)
htmlize-decode-face-prop(PROP)
htmlize-decode-invisibility-spec(INVISIBLE)
htmlize-default-body-tag(FACE-MAP)
htmlize-default-pre-tag(FACE-MAP)
htmlize-default-transform-image(IMGPROPS TEXT)
htmlize-despam-address(STRING)
htmlize-display-prop-to-html(DISPLAY TEXT)
htmlize-escape-or-link(STRING)
htmlize-extract-text(BEG END TRAILING-ELLIPSIS)
htmlize-face-background(FACE)
htmlize-face-color-internal(FACE FG)
htmlize-face-css-name(FACE)
htmlize-face-foreground(FACE)
htmlize-face-set-from-keyword-attr(FSTRUCT ATTR VALUE)
htmlize-face-size(FACE)
htmlize-face-to-fstruct(FACE)
htmlize-face-to-fstruct-1(FACE)
htmlize-faces-in-buffer()
htmlize-file(FILE &optional TARGET)
htmlize-font-body-tag(FACE-MAP)
htmlize-font-pre-tag(FACE-MAP)
htmlize-font-text-markup(FSTRUCT-LIST BUFFER)
htmlize-format-link(LINKPROPS TEXT)
htmlize-fstruct-background(htmlize-fstruct-background X)
htmlize-fstruct-background--inliner(INLINE--FORM X)
htmlize-fstruct-boldp(htmlize-fstruct-boldp X)
htmlize-fstruct-boldp--inliner(INLINE--FORM X)
htmlize-fstruct-css-name(htmlize-fstruct-css-name X)
htmlize-fstruct-css-name--inliner(INLINE--FORM X)
htmlize-fstruct-foreground(htmlize-fstruct-foreground X)
htmlize-fstruct-foreground--inliner(INLINE--FORM X)
htmlize-fstruct-italicp(htmlize-fstruct-italicp X)
htmlize-fstruct-italicp--inliner(INLINE--FORM X)
htmlize-fstruct-overlinep(htmlize-fstruct-overlinep X)
htmlize-fstruct-overlinep--inliner(INLINE--FORM X)
htmlize-fstruct-p(X)
htmlize-fstruct-p--inliner(INLINE--FORM X)
htmlize-fstruct-size(htmlize-fstruct-size X)
htmlize-fstruct-size--inliner(INLINE--FORM X)
htmlize-fstruct-strikep(htmlize-fstruct-strikep X)
htmlize-fstruct-strikep--inliner(INLINE--FORM X)
htmlize-fstruct-underlinep(htmlize-fstruct-underlinep X)
htmlize-fstruct-underlinep--inliner(INLINE--FORM X)
htmlize-generate-image(IMGPROPS ORIGTEXT)
htmlize-get-color-rgb-hash(&optional RGB-FILE)
htmlize-get-override-fstruct(FACE)
htmlize-get-text-with-display(BEG END)
htmlize-inline-css-body-tag(FACE-MAP)
htmlize-inline-css-pre-tag(FACE-MAP)
htmlize-inline-css-text-markup(FSTRUCT-LIST BUFFER)
htmlize-make-face-map(FACES)
htmlize-make-file-name(FILE)
htmlize-make-link-overlay(BEG END URI)
htmlize-make-tmp-overlay(BEG END PROPS)
htmlize-many-files(FILES &optional TARGET-DIRECTORY)
htmlize-many-files-dired(ARG &optional TARGET-DIRECTORY)
htmlize-match-inv-spec(INV)
htmlize-memoize(KEY GENERATOR)
htmlize-merge-faces(FSTRUCT-LIST)
htmlize-merge-size(MERGED NEXT)
htmlize-merge-two-faces(MERGED NEXT)
htmlize-method(METHOD &rest ARGS)
htmlize-method-function(METHOD)
htmlize-next-change(POS PROP &optional LIMIT)
htmlize-next-face-change(POS &optional LIMIT)
htmlize-overlay-faces-at(POS)
htmlize-protect-string(STRING)
htmlize-region(BEG END &optional INTERACTIVE)
htmlize-region-for-paste(BEG END)
htmlize-region-save-screenshot(BEG END)
htmlize-string-to-html(STRING)
htmlize-trim-ellipsis(TEXT)
htmlize-unstringify-face(FACE)
htmlize-untabify-string(TEXT START-COLUMN)
make-htmlize-fstruct
make-htmlize-fstruct--cmacro

Defined faces (0)