From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel <rick@rickster.com> Subject: Re: colorize html output when batch exporting Date: Wed, 15 Jan 2014 09:39:53 -0500 Message-ID: <fb287c579621e76d1347beb477c5c5be@mail.rickster.com> References: <m2txd6pth5.fsf@polytechnique.org> <456aae79ec3109523d0d19759b73b0eb@mail.rickster.com> <m2d2jtn01n.fsf@polytechnique.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org> Received: from eggs.gnu.org ([2001:4830:134:3::10]:43348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <rick@rickster.com>) id 1W3RdP-0004ND-Cp for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 09:40:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rick@rickster.com>) id 1W3RdJ-0008VQ-C3 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 09:39:59 -0500 Received: from mail.rickster.com ([204.62.15.78]:54254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rick@rickster.com>) id 1W3RdJ-0008VL-81 for emacs-orgmode@gnu.org; Wed, 15 Jan 2014 09:39:53 -0500 In-Reply-To: <m2d2jtn01n.fsf@polytechnique.org> List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode> List-Post: <mailto:emacs-orgmode@gnu.org> List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>, <mailto:emacs-orgmode-request@gnu.org?subject=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: Alan Schmitt <alan.schmitt@polytechnique.org> Cc: emacs-orgmode <emacs-orgmode@gnu.org> On 2014-01-15 03:04, Alan Schmitt wrote: > Quick summary: I'm now able to generate the css, but I don't understand > how it can change the colors. > However, I still find there is a problem. Here is the html source > generated from a snippet of the file: > > #+BEGIN_SRC html > <div class="org-src-container"> > > <pre class="src src-coq">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 > </pre> > </div> > #+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? Yes, it should. Something is not right with your output. I'm not familiar with coq, and i don't have coq-mode.el, but from the above it looks like a BNF grammar. Are you sure coq-mode was loaded when you did the export? Could you try a simple example? Here's a mimimal org file #+BEGIN_SRC org ,#+OPTIONS: html-postamble:nil html-preamble:nil html-scripts:nil html-style:nil ,#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="org.css" /> ,#+HTML_DOCTYPE: xhtml5 ,* Test htmlize ,*Note:* =org-html-htmlize-output-type= is ~css~ ,#+BEGIN_SRC perl :exports code print "foo\n"; ,#+END_SRC #+END_SRC and the results i get: #+BEGIN_HTML <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>html</title> <meta charset="utf-8" /> <meta name="generator" content="Org-mode" /> <meta name="author" content="Rick Frankel" /> <link rel="stylesheet" href="org.css" /> </head> <body> <div id="content"> <h1 class="title">html</h1> <div id="table-of-contents"> <h2>Table of Contents</h2> <div id="text-table-of-contents"> <ul> <li><a href="#sec-1">Test htmlize</a></li> </ul> </div> </div> <div id="outline-container-sec-1" class="outline-2"> <h2 id="sec-1">Test htmlize</h2> <div class="outline-text-2" id="text-1"> <p> <b>Note:</b> <code>org-html-htmlize-output-type</code> is <code>css</code> </p> <div class="org-src-container"> <pre class="src src-perl"><span class="org-cperl-nonoverridable">print</span> <span class="org-string">"foo\n"</span>; </pre> </div> </div> </div> </div> </body> </html> #+END_HTML