Variable: org-html-htmlize-output-type

org-html-htmlize-output-type is a customizable variable defined in ox-html.el.gz.

Value

inline-css

Documentation

Output type to be used by htmlize when formatting code snippets.

Choices are css to export the CSS selectors only,inline-css to export the CSS attribute values inline in the HTML or nil to export plain text. We use as default inline-css, in order to make the resulting HTML self-containing.

However, this will fail when using Emacs in batch mode for export, because then no rich font definitions are in place. It will also not be good if people with different Emacs setup contribute HTML files to a website, because the fonts will represent the individual setups. In these cases, it is much better to let Org/Htmlize assign classes only, and to use a style file to define the look of these classes. To get a start for your css file, start Emacs session and make sure that all the faces you are interested in are defined, for example by loading files in all modes you want. Then, use the command M-x org-html-htmlize-generate-css (org-html-htmlize-generate-css) to extract class definitions.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-html.el.gz
;;;; Src Block

(defcustom org-html-htmlize-output-type 'inline-css
  "Output type to be used by htmlize when formatting code snippets.
Choices are `css' to export the CSS selectors only,`inline-css'
to export the CSS attribute values inline in the HTML or nil to
export plain text.  We use as default `inline-css', in order to
make the resulting HTML self-containing.

However, this will fail when using Emacs in batch mode for export, because
then no rich font definitions are in place.  It will also not be good if
people with different Emacs setup contribute HTML files to a website,
because the fonts will represent the individual setups.  In these cases,
it is much better to let Org/Htmlize assign classes only, and to use
a style file to define the look of these classes.
To get a start for your css file, start Emacs session and make sure that
all the faces you are interested in are defined, for example by loading files
in all modes you want.  Then, use the command
`\\[org-html-htmlize-generate-css]' to extract class definitions."
  :group 'org-export-html
  :type '(choice (const css) (const inline-css) (const nil))
  :safe #'symbolp)