emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rick Frankel <rick@rickster.com>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: colorize html output when batch exporting
Date: Wed, 15 Jan 2014 09:39:53 -0500	[thread overview]
Message-ID: <fb287c579621e76d1347beb477c5c5be@mail.rickster.com> (raw)
In-Reply-To: <m2d2jtn01n.fsf@polytechnique.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 -&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	other threads:[~2014-01-15 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 13:45 colorize html output when batch exporting Alan Schmitt
2014-01-14 18:25 ` Rick Frankel
2014-01-15  8:04   ` Alan Schmitt
2014-01-15 14:39     ` Rick Frankel [this message]
2014-01-15 15:24       ` Alan Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb287c579621e76d1347beb477c5c5be@mail.rickster.com \
    --to=rick@rickster.com \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).