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 -&gt; expr
| expr_literal : literal -&gt; expr
| expr_object : list (propname * propbody) -&gt; expr
| expr_function : option string -&gt; list string -&gt; funcbody -&gt; expr
| expr_access : expr -&gt; expr -&gt; expr
| expr_member : expr -&gt; string -&gt; expr
| expr_new : expr -&gt; list expr -&gt; expr
| expr_call : expr -&gt; list expr -&gt; expr
| expr_unary_op : unary_op -&gt; expr -&gt; expr
| expr_binary_op : expr -&gt; binary_op -&gt; expr -&gt; expr
| expr_conditional : expr -&gt; expr -&gt; expr -&gt; expr
| expr_assign : expr -&gt; option binary_op -&gt; expr -&gt; 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

Reply via email to