emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jos'h Fuller <Jos'h.Fuller@arcproductions.com>
To: Eric Schulte <eric.schulte@gmx.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Arbitrary colouration of words/sentences etc. in HTML export?
Date: Tue, 21 Aug 2012 16:28:13 +0000	[thread overview]
Message-ID: <44B0EAE8544C834188E8790873CDE1CC226BF91F@ARCEXCHANGE.arc.local> (raw)
In-Reply-To: <87obm4w7qd.fsf@gmx.com>

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:eric.schulte@gmx.com]
> Sent: Tuesday, August 21, 2012 12:06 PM
> To: Jos'h Fuller
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] Arbitrary colouration of words/sentences etc. in HTML
> export?
> 
> Jos'h Fuller <Jos'h.Fuller@arcproductions.com> 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	other threads:[~2012-08-21 16:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21 15:38 Arbitrary colouration of words/sentences etc. in HTML export? Jos'h Fuller
2012-08-21 16:05 ` Eric Schulte
2012-08-21 16:28   ` Jos'h Fuller [this message]
2012-08-21 17:49   ` Bastien

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=44B0EAE8544C834188E8790873CDE1CC226BF91F@ARCEXCHANGE.arc.local \
    --to=jos'h.fuller@arcproductions.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.com \
    /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).