emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] html export: what do codehighlighton/off functions do?


From: Rasmus
Subject: Re: [O] html export: what do codehighlighton/off functions do?
Date: Thu, 12 Nov 2015 18:02:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Manuel Koell <address@hidden> writes:

> Can someone please tell me what these functions do?
>
> ```
>
> function CodeHighlightOn(elem, id) {   var target =
> document.getElementById(id);   if(null != target) {
> elem.cacheClassElem = elem.className;     elem.cacheClassTarget =
> target.className;     target.className = "code-highlighted";
> elem.className   = "code-highlighted";   } } function
> CodeHighlightOff(elem, id) {   var target =
> document.getElementById(id);   if(elem.cacheClassElem)
> elem.className = elem.cacheClassElem;   if(elem.cacheClassTarget)
> target.className = elem.cacheClassTarget; }
>
>
> ```
>
> The only thing I could think of is to toggle some classes, but I can't seem
> to find some real world example out there. This javascript code is included
> on every export, doesn't matter if you've src/example blocks in your org
> file or not.

It is used for "coderefs" links.  Example from unit tests:

#+BEGIN_SRC emacs-lisp
(+ 1 1)                  (ref:sc)
#+END_SRC
[[(sc)]]

It will highlight the appropriate line in the html export.

Are you asking us to remove the javascript conditionally on whether we
think it will be used?  This sounds hard.

You can remove the JS via the buffer option html-scripts or via
org-html-head-include-scripts.

Hope it helps,
Rasmus

-- 
I hear there's rumors on the, uh, Internets. . .




reply via email to

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