[Top][All Lists]

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

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

From: Manuel Koell
Subject: Re: [O] html export: what do codehighlighton/off functions do?
Date: Fri, 13 Nov 2015 20:55:55 +0100

Sorry, I didn't know such feature exists in org mode! It's just kinda weird, these function still get called from onmouseover/onmouseout bindings.

2015-11-12 18:02 GMT+01:00 Rasmus <address@hidden>:
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)

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

Hope it helps,

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

reply via email to

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