|
From: | Manuel Koell |
Subject: | Re: [O] html export: what do codehighlighton/off functions do? |
Date: | Fri, 13 Nov 2015 20:55:55 +0100 |
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. . .
[Prev in Thread] | Current Thread | [Next in Thread] |