From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: html export: what do codehighlighton/off functions do? Date: Thu, 12 Nov 2015 18:02:16 +0100 Message-ID: <87mvujjgmf.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwvGV-0005NH-QP for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 12:02:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwvGS-0000dP-0D for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 12:02:27 -0500 Received: from plane.gmane.org ([80.91.229.3]:58055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwvGR-0000dJ-Qp for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 12:02:23 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZwvGQ-0004NM-Hg for emacs-orgmode@gnu.org; Thu, 12 Nov 2015 18:02:22 +0100 Received: from 62.80.108.11 ([62.80.108.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2015 18:02:22 +0100 Received: from rasmus by 62.80.108.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 12 Nov 2015 18:02:22 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Manuel Koell 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. . .