Hi, Eric,
Thanks for trying this out -- I should have taken the trouble to write
out sample code myself.
Just for completeness I'm adding an example of a color handler which can
be added to a users config to enable colorization of exported text to
html and latex.
--8<---------------cut here---------------start------------->8---
(org-add-link-type
"color" nil
(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)))))
--8<---------------cut here---------------end--------------->8---
A drawback with using links for markup is that the user sees things that
look like links, but do nothing when clicked, except give error messages.
So instead of setting the third argument -- the "follow" function -- to
nil, I'd flash the user an informative message, e.g.
--8<---------------cut here---------------start------------->8---
(org-add-link-type
"color"
(lambda (path)
(message
(format "This link adds %s color but goes nowhere" 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)))))
--8<---------------cut here---------------end--------------->8---
Yours,
Christian
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode