emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: html export: what do codehighlighton/off functions do?
Date: Thu, 12 Nov 2015 18:02:16 +0100	[thread overview]
Message-ID: <87mvujjgmf.fsf@gmx.us> (raw)
In-Reply-To: CAAAbm0rmiXs7eZ2bPiRwdCoXOWGk_HuN=2gYmZWgnZ0ri4bFPQ@mail.gmail.com

Manuel Koell <man.koell@gmail.com> 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	other threads:[~2015-11-12 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 16:27 html export: what do codehighlighton/off functions do? Manuel Koell
2015-11-12 17:02 ` Rasmus [this message]
2015-11-13 19:55   ` Manuel Koell
2015-11-14  0:07     ` Rasmus
2015-11-15 23:34       ` Manuel Koell
2015-11-21 16:44         ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvujjgmf.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).