summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-02-12 11:59:09 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-02-12 18:29:06 +0100
commitd8780dbbee10005d234fd33565b552d9f8ec6450 (patch)
treeaa9f6deebb7d49c9c33312119bd9c85cfea71899
parentc32de18ae026aeef8f9c952033e5e840c87b5b75 (diff)
downloadorg-mode-d8780dbbee10005d234fd33565b552d9f8ec6450.tar.gz
HTML export: Allow special colors for each TODO keyword
Wanrong Lin writes: Right now in the HTML export the TODO keywords have either class="todo", or class="done". That loses all the face properties in the original TODO keywords. I think the TODO keywords faces are important visual aids to differentiate different types of TODO items, so I just wonder whether it is possible to keep the faces in the HTML. This makes sense. This commit adds, to each TODO keyword, an additional class named after the keyword. For example: <span class="todo WAITING">WAITING</span> So each todo keyword gets class "todo" or "done" depending on which general type it is. And in addition it gets itself as class. So go to your CSS file and configure like this: .todo { font-weight:bold; } .done { font-weight:bold; } .TODO { color:red; } .WAITING { color:orange; } .DONE { color:green; } Thanks to Sebastian Rose for the multiple-classes trick.
-rw-r--r--doc/org.texi5
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-exp.el3
3 files changed, 8 insertions, 3 deletions
diff --git a/doc/org.texi b/doc/org.texi
index 6d92c3d..e2e019f 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -8109,8 +8109,9 @@ assigns the following special CSS classes to appropriate parts of the
document - your style specifications may change these, in addition to any of
the standard classes like for headlines, tables etc.
@example
-.todo @r{TODO keywords}
-.done @r{the DONE keyword}
+.todo @r{TODO keywords, all not-done states}
+.done @r{the DONE keywords, all stated the count as done}
+WAITING @r{Each TODO keyword also uses a class named after itself}
.timestamp @r{time stamp}
.timestamp-kwd @r{keyword associated with a time stamp, like SCHEDULED}
.tag @r{tag in a headline}
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe65987..4b5ca04 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-02-12 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-exp.el (org-export-as-html): Add TODO keyword as extra
+ class, so that each keyword can get special colors through CSS.
+
* org-clock.el (org-clock-out): Add another nil for the previous
state into the call to `org-add-log-setup'.
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index c40c6b2..9cd336c 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -3743,7 +3743,8 @@ lang=\"%s\" xml:lang=\"%s\">
(if (member (match-string 2 line)
org-done-keywords)
"done" "todo")
- "\">" (match-string 2 line)
+ " " (match-string 2 line)
+ "\"> " (match-string 2 line)
"</span>" (substring line (match-end 2)))))
;; Does this contain a reference to a footnote?