From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: colorize html output when batch exporting Date: Tue, 14 Jan 2014 14:45:42 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34JU-0006wK-EM for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 08:45:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W34JM-0005ux-SL for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 08:45:52 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:2411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34JM-0005uH-LD for emacs-orgmode@gnu.org; Tue, 14 Jan 2014 08:45:44 -0500 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Hello, I'm trying to batch export a file, and I don't seem to have colorization working. Reading the documentation a bit, I found this information: ,---- | org-html-htmlize-output-type is a variable defined in `ox-html.el'. | Its value is inline-css | | Documentation: | Output type to be used by htmlize when formatting code snippets. | Choices are `css', to export the CSS selectors only, or `inline-css', to | export the CSS attribute values inline in the HTML. 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 to extract class definitions. `---- Following these instructions, I set up this variable in the init.el called upon batch exporting, among other things: #+BEGIN_SRC emacs-lisp (add-to-list 'load-path (file-name-directory load-file-name)) (require 'local_settings) (require 'org) (require 'ox-html) (setq org-html-postamble nil) (setq org-html-htmlize-output-type 'css) (setq org-confirm-babel-evaluate nil) #+END_SRC Unfortunately I could not complete the next step (to get a start on the css file), as `org-html-htmlize-generate-css` results in an error "face-attribute: Invalid face: font-lock-comment". I tried to toggle debug on error, but it does nothing. Are there suggestions on how to generate this css file for a nice coloring of my code? Thanks, Alan