emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Arbitrary colouration of words/sentences etc. in HTML export?


From: Jos'h Fuller
Subject: Re: [O] Arbitrary colouration of words/sentences etc. in HTML export?
Date: Tue, 21 Aug 2012 16:28:13 +0000

Perfect! Thanks /very/ much!

_______________________________________________________________________________

Jos'h Fuller, Production Programmer

Arc Productions Ltd.     

p: 416.682.5237          | f: 416.682.5209     | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


> -----Original Message-----
> From: Eric Schulte [mailto:address@hidden
> Sent: Tuesday, August 21, 2012 12:06 PM
> To: Jos'h Fuller
> Cc: address@hidden
> Subject: Re: [O] Arbitrary colouration of words/sentences etc. in HTML
> export?
> 
> Jos'h Fuller <Jos'address@hidden> writes:
> 
> > Hi!
> >
> > Is there any good quick and /simple/ way to drop an arbitrary colour
> on a sequence of characters that will show up in the exported HTML
> page?
> >
> > I have introduced a colleague to org-mode for generating
> > documentation, however they want to use multiple colours to highlight
> > different terms. Adding a CSS style rule for *bold* is OK, but it
> > would be nice to do other colours without rendering the other common
> > styles (/i/, _underscore_, etc.) useless. Something like:
> >
> >     #+HTML: <span class="greenish">
> >     Greenword
> >     #+HTML: </span>
> >
> > or even this:
> >
> >     @<span style="color: green"> Greenword @</span>
> >
> > is far too clumsy. Especially since they're using it partly so they
> don't have to deal with HTML.
> >
> > Any better way to do this?
> >
> 
> Hi Jos'h,
> 
> Add the following to your Emacs config,
> 
>     ;; -*- emacs-lisp -*-
>     (org-add-link-type
>      "color"
>      (lambda (path)
>        (message (concat "color "
>                         (progn (add-text-properties
>                                 0 (length path)
>                                 (list 'face `((t (:foreground ,path))))
>                                 path) path))))
>      (lambda (path desc format)
>        (cond
>         ((eq format 'html)
>          (format "<span style=\"color:%s;\">%s</span>" path desc))
>         ((eq format 'latex)
>          (format "{\\color{%s}%s}" path desc)))))
> 
> and then you can use [[color:red][in red]] for colored export.
> 
> Best,
> 
> --
> Eric Schulte
> http://cs.unm.edu/~eschulte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]