From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: colorize html output when batch exporting Date: Wed, 15 Jan 2014 09:04:20 +0100 Message-ID: References: <456aae79ec3109523d0d19759b73b0eb@mail.rickster.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3LU3-0000yb-DV for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 03:06:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3LTx-0001Uk-88 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 03:05:55 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:13214) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3LTx-0001UV-1G for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 03:05:49 -0500 In-Reply-To: <456aae79ec3109523d0d19759b73b0eb@mail.rickster.com> (Rick Frankel's message of "Tue, 14 Jan 2014 13:25:07 -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: Rick Frankel Cc: emacs-orgmode Quick summary: I'm now able to generate the css, but I don't understand how it can change the colors. Rick Frankel writes: > Which version of emacs are you using? FWIW, I just had this problem > yesterday (although it choked on a different face) in emacs trunk > (24.4.x). But on my machine @work on (24.3.8) it is working fine. I'm on 24.3.1. > It seems that htmlize is choking on invalid face definitions. > Somewhere you have a reference to a face "font-lock-comment" which > does not exist (the correct definition in this case is > "font-lock-comment-face"), so if you can find the customization that > refers to "font-lock-comment" and fix it you should be able to > generate the CSS. Thank you for the suggestion. I had a quick look at what org-html-htmlize-generate-css is doing, and it starts by building a face-list which is used in my case. I thought the problem was that I had been using this instance of emacs for too long (thus many faces where loaded), but with a fresh emacs, I still have an error (this time for `font-lock-pseudo-keyword-face`). Loading an emacs with no configuration (except for org and htmlize), I'm now able to generate the CSS. After loading the mode of interest, I now know the names of the classes I should work with. However, I still find there is a problem. Here is the html source generated from a snippet of the file: #+BEGIN_SRC html
Inductive expr :=
  | expr_this : expr
  | expr_identifier : string -> expr
  | expr_literal : literal -> expr
  | expr_object : list (propname * propbody) -> expr
  | expr_function : option string -> list string -> funcbody -> expr
  | expr_access : expr -> expr -> expr
  | expr_member : expr -> string -> expr
  | expr_new : expr -> list expr -> expr
  | expr_call : expr -> list expr -> expr
  | expr_unary_op : unary_op -> expr -> expr
  | expr_binary_op : expr -> binary_op -> expr -> expr
  | expr_conditional : expr -> expr -> expr -> expr
  | expr_assign : expr -> option binary_op -> expr -> expr
#+END_SRC I don't understand how things are supposed to be colorized, as there is no mention in the html of span elements to put color on. For instance, "Inductive" is a keyword, and in a coq buffer it has face "font-lock-keyword-face". Shouldn't it have class "org-keyword" in the generated html? Thanks, Alan