emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Manuel Koell <man.koell@gmail.com>
To: Rasmus <rasmus@gmx.us>
Cc: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: html export: what do codehighlighton/off functions do?
Date: Fri, 13 Nov 2015 20:55:55 +0100	[thread overview]
Message-ID: <CAAAbm0pNOobxFxa3OiQziTjjjgiB8W+5vtC8dYMTH5srMgXHWQ@mail.gmail.com> (raw)
In-Reply-To: <87mvujjgmf.fsf@gmx.us>

[-- Attachment #1: Type: text/plain, Size: 1651 bytes --]

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 <rasmus@gmx.us>:

> 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. . .
>
>
>

[-- Attachment #2: Type: text/html, Size: 2359 bytes --]

  reply	other threads:[~2015-11-13 19:55 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
2015-11-13 19:55   ` Manuel Koell [this message]
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=CAAAbm0pNOobxFxa3OiQziTjjjgiB8W+5vtC8dYMTH5srMgXHWQ@mail.gmail.com \
    --to=man.koell@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /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).