1 #+TITLE: EMACS ORG-INFO.JS
2 #+AUTHOR: Sebastian Rose
3 #+STARTUP: align fold nodlcheck hidestars oddeven lognotestate
7 #+INFOJS_OPT: path:org-info.js
8 #+INFOJS_OPT: toc:nil ltoc:above view:info mouse:underline buttons:nil
9 #+INFOJS_OPT: up:https://orgmode.org/worg/
10 #+INFOJS_OPT: home:https://orgmode.org
11 #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
13 * The Name of the Game
15 org-info-js (subsequently called /the script/) implements part of Emacs
16 Org-mode in its XHTML-exported files, allowing them to be rendered and
17 browsed in a linuxdoc/texinfo style.
19 This documentation is one XHTML file, exported from one *.org file
20 using a single keyboard shortcut. No additional postprocessing was
21 done. There are no external dependencies and the script is small and
22 fast, even for large files. It is used on the [[https://orgmode.org/Changes.html][org-mode site]] to
23 display =ORGWEBPAGE/Changes.org= which consists of more than 220
26 If you don't mind using it despite the /health warnings/ we wish you
27 good luck and hope the fun will outweigh your effort.
29 There are some drawbacks though. It is currently not possible to open
30 internal links in another tab (e.g. using middle click in Firefox) due
31 my poor JavaScript knowledge. This is not very high on my TODO list
32 since the history mechanism of the script is a good alternative to tab
35 Go to the next section by pressing '=n='.
37 Find out about shortcuts in section [[#shortcuts][Shortcuts]] (and come back here
38 pressing '=b='). In addition, '=?=' will show all shortcuts available.
42 - A list of changes can be found [[file:changes.org][here]] (separate file).
44 - Download the [[file:org-info.js][minified version]] or the [[file:org-info-src.js][source code]].
46 - Create the minified versions from the sources using the =Makefile= and
47 a little sed script (see within this directory).
49 Development of the script takes place on [[http://github.com/SebastianRose/org-info-js/tree/master][github]], but every working
50 release is published here on Worg synchronously. That said, you can
51 follow the development by tracking the Worg repo as well, available
52 at [[https://code.orgmode.org/bzg/worg]].
54 ** Terms used throughout this Document
59 The script knows three different so called /view modes/. One may toggle
60 the view mode by pressing '=m=' or click the /toggle view/ link the script
61 adds to your pages. Currently three view modes exist:
64 This mode displays the sections one by one, paged like the
65 typical linuxdoc or texinfo files. This is the view mode you
66 should face when first visiting this documentation.
68 + *plain view mode* ::
69 This mode displays the entire file. In this mode the sections are
70 foldable by clicking the headlines or pressing '=f=' (fold). The
71 entire structure of the document may be (un-)folded using
72 '=F='. You may determine what's visible on page load.
74 + *presentation mode* ::
75 This mode displays sections one by one as slides. Still very
76 rustic and experimental. Rick Moynihan embarked and we plan a
77 separate tool for presentations, but...
79 The table of contents (*TOC*) is required, albeit it may be hidden
80 (CSS). The TOC may be visited using '=i=' (index) regardless of its
83 A *section* is everything with a headline.
91 + *Toggle plain view, info view and presentation* ::
92 One can click the script-generated links in info view mode to
93 read through the whole file page by page. By clicking on '/toggle
94 view/' (or pressing `m´) you can switch between info and plain
95 view mode. The presentation mode is very rudimentary and just a
96 quick hack realy. Press 'x' to see it.
97 + *Keep place in file when toggling* ::
98 When changing the view mode via the '/toggle view/' links, the
99 reader gets the same part of the document presented after the
100 view change as he saw before.
102 You may cut the table of contents to a certain depth. The
103 splitting of the document is not affected by this option. Hence
104 you might set the level of headlines to 4, but cut the TOC to
105 show only the first two levels.
106 + *Optional subindexes* ::
107 The script optionally creates subindexes under the headline of a
108 section containing subsections not exceeding
109 =org-export-headline-levels=. This was done to get a more
110 texinfo/linuxdoc kind of feel and a better orientaton.
111 + *Startupview customizable* ::
112 Choose how to display the document on load. Info-like or plain
114 + *Toggle links everywhere / only on top* ::
115 You may choose to display the '/toggle view/' links above every
116 headline or just next the current sections headline.
117 + *Numbered pages* ::
118 In info view mode every page gets a page number starting from
120 + *Markright alike headings* ::
121 Info view mode only. Similar to the =\markright= command in LaTeX
122 the Title of the current sections parent appears on top of each
123 page. In subsections this heading can be use as link up to start
124 of the parent section (see top of this page when you're in info
125 view mode). You can move to the parent section by pressing `u´
128 Moving the mouse on the navigation links shows a tooltip with
129 name of next/previous section.
131 The TOC can be hidden completly. Hitting '=i=' still will show
132 it. When showing the TOC hitting '=i=' any navigation command ('=n=',
133 '=p=', '=s='...) will trigger an history-back. Thus the TOC will not
134 get in your way when navigating the history later on.
136 ** Keyboard navigation
138 + *Easy keyboard navigation* ::
139 See Section [[#shortcuts][Shortcuts]] for a list of shortcuts.
140 + Navigation history ::
141 Navigating a file through the keyboard shortcuts is recorded in
142 an internal history. You may go back and forth in this
143 history. Once an end is reached, org-info.js tries to go
144 back/forth in the browsers history. If you move back to a
145 previous visited file that uses the script, you will return to
146 the place you left the file. Thus following links in published
147 files feels like following footnotes.
148 + *Customizable features* ::
149 All features are customizable simply by setting up your export
150 options template (see [[#setup][Setup]]).
152 Emulates the way of folding in emacs Org-mode. Mouse supported.
156 + *Full text-search with highlighting* :: Search forward, backwards, repeated
157 search... (experimental). Simple regular expressions are supported. Try to
158 search for =a[e-h].*n= for example. All searches are case
159 insensitive. Grouping is not supported. We couldn't search for round
160 brackets otherwise. Supported are wildcards (e.g. =.*=) and ranges
161 (e.g. =[a-g]=). Sometimes only one match is found between two HTML tags. The
162 longer the expression, the better the matches.
164 As experimental as the text-search, but I love this one. You may link to a
165 file using this script like this: =index.html?OCCUR=java=. Use regular
166 expressions likewise.
168 '=C=' shows a table of contents based on tags. Inherited tags are not
169 supported yet. This was an [[http://lists.gnu.org/archive/html/emacs-orgmode/2008-07/msg00434.html][idea of Rick Moynihan]].
174 The exported pages can be linked to the homepage and an directory index or
175 some other sort of parent file.
176 + *Adjusted internal links* ::
177 Internal links to section headings are automatically adjusted to work with
178 this script. When following such internal links, one may go back again
180 + *Detect the target in the URL* ::
181 If the URL is suffixed by '=#sec-x.y.z=' that section will be displayed
183 + *Structure is taken from export preferences* ::
184 The paging is done according to your setting of
185 =org-export-headline-levels=. Scanning the TOC is a good way to get
186 around browser detection. An option to hide the TOC exists.
187 + *Startup information* ::
188 Show a little message on page load to tell the visitor about the script
190 + *Wrap text before first headline* :: This is a temporary fix for the missing
191 =<p>= element around the text before the first headline, available since
192 version 0.0.7.3a (fixed in current Org-mode versions). If you export with
193 =skip:nil=, you may add this to your stylesheet:
194 : #text-before-first-headline {color:red;font-weight:bold;}
195 + Hooks :: The OrgHtmlManager object provides hooks (two currently) to add
200 :CUSTOM_ID: shortcuts
203 The visitor of this file (and every XHTML-exported org file that includes the
204 script) may use the mouse or the following keys to navigate. '=?=' should give
205 you a list of shortcuts.
207 The script always tries to keep the last selected section visible. This is
208 somewhat strange when scrolling, but really helpful for keyboard navigation.
210 The TOC is handled specially, when hidden. If you press '=i=', the TOC is
211 displayed. Any subsequent key press goes back to where you've been before. The
212 TOC does not show up the history. Same applies to the keyboard help.
215 |-----------+---------------------------------------------------------|
216 | ? / ¿ | show this help screen |
217 |-----------+---------------------------------------------------------|
218 | | *Moving around* |
219 | n / p | goto the next / previous section |
220 | N / P | goto the next / previous sibling |
221 | t / E | goto the first / last section |
222 | g | goto section... |
223 | u | go one level up (parent section) |
224 | i / C | show table of contents / tags index |
225 | b / B | go back to last / forward to next visited section. |
226 | h / H | go to main index in this directory / link HOME page |
227 |-----------+---------------------------------------------------------|
229 | m / x | toggle the view mode between info and plain / slides |
230 | f / F | fold current section / whole document (plain view only) |
231 |-----------+---------------------------------------------------------|
233 | s / r | search forward / backward.... |
234 | S / R | search again forward / backward |
236 | c | clear search-highlight |
237 |-----------+---------------------------------------------------------|
239 | l / L / U | display HTML link / Org link / Plain-URL |
240 | v / V | scroll down / up |
242 Thanks Carsten, for this beautiful table!
249 This section describes how to setup your org files to use the
250 script. [[#the-new-way][Export-Setup - the new Way]] covers setting up org XHTML
251 export with Org-mode version >= 6.02. For those using an older
252 Org-mode version < 6.02 the next section ([[#the-old-way][Export-Setup - the old Way]])
253 remains. [[#using-set][Using Set()]] contains a list of all supported options for adjusting
254 the =org\_html\_manager= to suit your needs.
256 See the Download section on how to obtain a version of the script.
258 The first version of this document was created with the new XHTML exporter
259 which was revised by Carsten Dominik in March 2008 (in Org-mode v5.23a+) to
260 better support =XML=. You can use =M-x org-version= to see which version of
261 Org-mode you have installed.
263 ** Export-Setup - the new Way
265 :CUSTOM_ID: the-new-way
268 The modern way of org export setup provides extra options to include and
269 configure the script, as well as an emacs customize interface for this very
270 purpose. Options set in customize may be overwritten on a per-file basis
271 using one or more special =#+INFOJS_OPT:= lines in the head of your org file.
273 As an example, the head of this org file looks like:
276 ,#+INFOJS_OPT: path:org-info.js
277 ,#+INFOJS_OPT: toc:nil ltoc:t view:info mouse:underline buttons:nil
278 ,#+INFOJS_OPT: up:https://orgmode.org/worg/
279 ,#+INFOJS_OPT: home:https://orgmode.org
284 To use customize type
285 : M-x customize-group RET org-export-html RET
286 scroll to the bottom and click =Org Export HTML INFOJS=.
288 On this page three main options may be configured. /Org Export Html Use
289 Infojs/ is very good documented and /Org Infojs Template/ should be
290 perfect by default. So I'll concentrate on /Org Infojs Options/ here.
293 Absolute or relative URL to the script as used in in XHTML
294 links. '=org-info.js=' will find the file in the current
295 directory. Keep in mind that this will be the directory of the
296 exported file, eventually a directory on a server.
299 What kind of view mode should the script enter on startup? Possible
301 + =info= --- info view mode,
302 + =overview= --- plain view mode, only first level headlines visible,
303 + =content= --- plain view mode, all headlines visible,
304 + =showall= --- plain view mode showing the entire document.
307 Show the table of contents? \\
309 + =t= --- show the toc,
310 + =nil= --- hide the toc (only show when '=i=' is pressed),
311 + =Publishing/Export property= --- derivate this setting from another
312 property like =org-export-with-toc=.
315 Should the script insert a local table of contents below the headings
316 of sections containing subsections? The default is no.\\
318 + =t= --- show the local toc below the first text in a section,
319 + =nil= --- hide the toc (only show when '=i=' is pressed). This is
320 the default, if this option is omitted.
321 + =above= --- sho the toc directly under the sections heading.
324 Highlight the headline under the mouse in plain view mode?
325 + =underline= --- underline the headline under mouse,
326 + =#dddddd= --- or any valid XHTML/CSS color value like =red= to draw a
327 colored background for the headline under the mouse.
331 Number of attempts to scan the document. It's no risk to set this to a
332 higher value than the default. The =org_html_manager= will stop as
333 soon as the entire document is scanned.
336 Affects plain view mode only. If '=t=', display the little
337 /Up|HOME|HELP|Toggle view/ links next to _each_ headline in plain view
340 *** Per File Basis: ~#+INFOJS_OPT~
342 A single file may overwrite the global options using a line like this:
345 ,#+INFOJS_OPT: view:info mouse:underline up:index.html home:http://www.mydomain.tpl toc:t
348 Possible options are the same as in the previous section. Additional (?)
352 An URL to link to the homepage. The text displayed is =HOME=.
354 An URL pointing to some main page. The text displayed is =Up=.
356 ** Export-Setup - the old Way
358 :CUSTOM_ID: the-old-way
361 This section describes the old way to setup the script using the
362 =org-export-html-style= configuration. If you own a current version (6.00
363 ++) of Org-mode you should better use [[#the-new-way][Export-Setup - the new Way]] of setting
364 up the export for script usage. You might want to read the sections [[#xhtml][The XHTML]]
365 for more information. [[#using-set][Using Set()]] contains a list of all supported options
366 recognised by the script.
368 *** Using a special * COMMENT Section
370 The second possibility to include the script is to add a special section
371 to the end of your org file (multiple lines possible):
374 ,* COMMENT html style specifications
376 ,# org-export-html-style: "<link rel=\"stylesheet\"
377 ,# type=\"text/css\" href=\"styles.css\" />
378 ,# <script type=\"text/javascript\" src=\"org-info.js\">
380 ,# <script type=\"text/javascript\">
382 ,# org_html_manager.set(\"LOCAL_TOC\", 1);
383 ,# org_html_manager.set(\"VIEW_BUTTONS\", \"true\");
384 ,# org_html_manager.set(\"MOUSE_HINT\", \"underline\");
385 ,# org_html_manager.setup ();
391 Ensure to precede all the verbatim double quotes with a backslash and
392 include the whole value of =org-export-html-style= into double quotes
397 One could customize the option '=org-export-html-style=' globaly by
398 :M-x cuomize-variable RET org-export-html-style RET
402 <script type="text/javascript" src="org-info.js"></script>
403 <script type="text/javascript">
405 org_html_manager.set("LOCAL_TOC", 1);
406 org_html_manager.set("VIEW_BUTTONS", "true");
407 org_html_manager.set("MOUSE_HINT", "underline");
408 org_html_manager.setup ();
413 This way all your files will be exported using the script in the
414 future. If you publish entire directories, supply an absolute URI to the
415 =src= attribute of the first script tag above.
417 *** Export-Setup per Project
419 Last but not least and very handy is the possibility to setup the usage of
420 the script per project. This is a taylor made passage of the org manual:
422 #+BEGIN_SRC emacs-lisp
423 (setq org-publish-project-alist
425 :base-directory "~/org/"
426 :publishing-directory "~/public_html"
428 :table-of-contents nil
429 :style "<link rel=stylesheet href=\"../other/mystyle.css\"
431 <script type=\"text/javascript\" src=\"org-info.js\"></script>
432 <script type=\"text/javascript\">
434 org_html_manager.setup ();
439 Don't forget to add an export target for the script itself ;-)
441 * Linking to Files using the Script
446 Just use the ordinary link syntax to link to files that use the script. Append
447 the section to the URL if neccessary:
449 : http://www.domain.tld/path/to/org.html#sec-3.4
451 One may overwrite the author's settings using special suffixes appended to the
452 URL of the script. Here are some examples linking to this section and changing
453 the intial view mode. Currently only the '/internal/' options are used (see
454 [[#using-set][Using set()]] for a list).
459 <a href="index.html?TOC=1&VIEW=info#sec-5"><code>index.html?TOC=1&VIEW=info#sec-5</code></a>
462 <a href="index.html?TOC=0&VIEW=overview#sec-5"><code>index.html?TOC=0&VIEW=overview#sec-5</code></a>
465 <a href="index.html?VIEW=content&TOC_DEPTH=1#sec-5"><code>index.html?VIEW=content&TOC_DEPTH=1#sec-5</code></a>
468 <a href="index.html?VIEW=showall&MOUSE_HINT=rgb(255,133,0)#sec-5"><code>index.html?VIEW=showall&MOUSE_HINT=rgb(255,133,0)#sec-5</code></a>
471 <a href="index.html?OCCUR=java"><code><b>index.html?OCCUR=java</b></code></a>
476 *Note* that it is not possible to change the '/HOME/' and '/Up/' links.
478 *Note* also that everything but =[0-9a-zA-Z\.-_]= should be URL encoded if used
486 Here is an excerpt from the stylesheet for this file. Be carful not to mess
487 things up when trying to position the console.
490 /* Styles for org-info.js */
492 .org-info-js_info-navigation
501 background-color:#ffffff;
504 #org-info-js_console-input
506 background-color:#ffffff;
510 vertical-align:middle;
513 #org-info-js_console-label
518 font-family:Verdana,Arial,sans-serif;
519 vertical-align:middle;
522 .org-info-js_console-label-warning
527 #org-info-js_console-container
529 border:1px solid #cccccc;
532 .org-info-js_search-highlight
534 background-color:#adefef; /* emacs default */
538 /* END STYLES FOR org-info.js */
543 The functionality of the script is based on =DOM=. This leads to some
544 incompatibility with legacy browsers. But hey, it's 2009, isn't it?
546 So what browsers are supported then? Well - I don't know for
547 sure. JavaScript™ 1.4 plus =DOM= should make
548 + Netscape 6.0 and higher
549 + Internet Explorer 5.0 and up
550 + Firefox 1.0 ++ - 2.0.0.12 and 3.0 Beta tested
551 + Opera 7.0 and higher - v.9.26 tested.
554 I try to test the script before each release in Firefox 3.x.x and Opera 10 on
555 Linux, and in FF 3, IE 6 and Safari on windows. Because of the number of
556 features and browsers, some bugs might remain undiscovered. Please report bugs
557 to the emacs-orgmode mailing list. In most cases we manage to fix them within
560 ** <<People reported it works in>>
562 So let's gather the tested Browsers here. Problems are only listed, if they
563 are Browser specific. Let me say it again: we don't wont to support legacy
566 | Browser | Version |
567 |-------------------+------------|
569 | Firefox/Iceweasel | 2.0.0.12 |
570 | Firefox/Iceweasel | 3.0.2 Beta |
574 If you manage to get this thingy working in any browser please let us know, so
575 we can update the above table.
577 * Why Do I Need a T.O.C?
579 Currently the script depends on the table of contents in the resulting
580 XHTML. The TOC can be hidden though.
582 The main reason is the behaviour of browsers. There is no safe way to detect
583 if the entire document is loaded at a certain point in time. Opera for example
584 returns =true= if we ask it =if(document.body)=. The =init()= function of the
585 =OrgHtmlManager= is aware of the possibility, that not even the TOC might
586 be loaded when this function is called. Hence it should work for slow
594 End users may consider this section obsolete as of org version 6.00-pre-3,
595 since there is a new configuration interface in org now to setup the script
596 without dealing with JavaScript. It is still here to show the desired look
597 of the head section of the XHTML. Also someone might be interested to use the
598 script for XHTML files not exported from org.
600 The script has to be included in the header of the resulting XHTML files. The
601 document structure has to be exactly the one produced by the current XHTML
602 export of emacs Org-mode.
603 You may pass options to the =org\_html\_manager= by utilising its =set()=
604 method. For a list of options see section [[#using-set][Using Set()]]. This is what the
605 head section should look like:
608 <script type="text/javascript" src="org-info.js"></script>
609 <script type="text/javascript">
611 org_html_manager.set("LOCAL_TOC", 1);
612 org_html_manager.set("TOC", 1);
613 org_html_manager.set("VIEW_BUTTONS", "1");
614 org_html_manager.set("MOUSE_HINT", "underline"); // or background-color like '#eeeeee'
615 org_html_manager.setup ();
620 To just use the script with the defaults put this into the head section of the
624 <script type="text/javascript" src="org-info.js"></script>
625 <script type="text/javascript">
627 org_html_manager.setup ();
632 I recommend the use of
635 <script type="text/javascript" src="org-info.js"></script>
641 <script type="text/javascript" src="org-info.js" />
644 which is valid XHTML but not understood by all browsers. I'll use the first
645 version throughout this document where ever the space allows to do so.
649 :CUSTOM_ID: using-set
653 : org_html_manager.setup ();
654 one may configure the script by using the =org\_html\_manager='s function
655 =set(key, val)=. There is one important rule for all of these options. If
656 you set a string value containing single quotes, do it this way:
657 : org_html_manager.set("key", "value with \\'single quotes\\'");
659 + =VIEW= :: Set to a true value to start in textinfo kind of view. Note: you
660 could also use =org\_html\_manager.INFO\_VIEW=,
661 =org\_html\_manager.PRESENTATION\_VIEW= or
662 =org\_html\_manager.PLAIN\_VIEW=. Defaults to plain view mode.
664 If =1=, hide the table of contents.
666 If set to a =true= (=1= or not empty string) value, create subindexes
667 for sections containing subsections. See sections 1 2, or 3.1 of this
668 document. The index below the headline (under 'Contents:') is generated
669 by the script. This one is off by default.
671 If =true=, include the small '/toggle view/' link above every headline in
672 plain view too. The visitor can toggle the view every where in the file
673 then. If =false=, only at the top of the file such a link is displayed
674 when in plain view. Default is =false=.
676 Highlight the heading under the mouse. This can be a background color
677 (like '=#ff0000=', '=red=' or '=rgb(230,230,230)=') or the keyword
680 May be set, to link to an other file, preferably the main index page of a
681 subdirectory. You might consider using an absolute URL here. This link will be
683 : <a href="LINK_UP">Up</a>
684 This way we can link files into a tree, if all subdirectories in the
685 project follow the same conventions. The '=h=' shortcut will
686 bring you there as well.
688 May be set, to link to an other file, preferably the main home page. This
689 link will be displayed as
690 : <a href="LINK_HOME">Up</a>
691 The '=H=' shortcut will trigger this action.
693 Cut the TOC at a certain level. This was done to support big big
694 files and was requested by Carsten Dominik. If '=0=' or not provided at
695 all the TOC will not be cut. If set to a number greater than '=0=',
696 the TOC will cut to only show headlines down to that very level.
698 Display a little message on page load? Defaults to no message. Set to =1=
699 to display the startup message.
706 Currently two hooks are provided. Each hook function is called with one or
707 more parameters the first of which is the OrgHtmlManager object.
709 - '~onReady~' :: This hook is run once the document is loaded, the view is
710 setup and the startup section is shown. The second parameter
711 is the first section shown, i.e. an OrgNode object.
712 - '~onShowSection~' :: This one runs after showing a new section. This hook is
713 not called for the first section shown. Use the '~onReady~' hook for the
714 first section. The second parameter is an object with to OrgNodes: the
715 previously shown section and the current section.
718 To add functions to the hooks, fill a global object ~orgInfoHooks~ with the
719 function objects you need. This is necessary, because code added via the
720 ~#+STYLE:~ option lines is executed before org-info.js is loaded.
723 ,#+STYLE: <script type="text/javascript">
724 ,#+STYLE: /* <![CDATA[ */
726 ,#+STYLE: var f = function(){ alert("I'll be removed :("); };
728 ,#+STYLE: orgInfoHooks = {
729 ,#+STYLE: 'onReady': [
730 ,#+STYLE: function(ohm, sec){alert("I'm the only 'onReady' hook here.");}
732 ,#+STYLE: 'onShowSection': [
734 ,#+STYLE: function (ohm, secs) {
735 ,#+STYLE: alert("You're looking at section "+secs['current']['I']+":\n"+
736 ,#+STYLE: "\n <<< "+ohm.rT(secs['current']['H']['innerHTML'])+" >>>");},
737 ,#+STYLE: function(){
738 ,#+STYLE: alert("I'll now remove my f and myself, too.");
739 ,#+STYLE: org_html_manager.removeHook('onShowSection', f);
740 ,#+STYLE: org_html_manager.removeHook('onShowSection',
741 ,#+STYLE: orgInfoHooks['onShowSection'][ orgInfoHooks['onShowSection'].length - 1 ]);}
747 *Make sure to remove hook functions at the end of the hook*. Strange things
748 could happen otherwise (the hook loop will overlook a member. While the hook
749 loop runs in first hook first, the remove loop removes the last hook first).
753 First of all the script is included in the header as described in [[#setup][Setup]]. The
754 document has to be exported with TOC since the script depends on it (See
755 [[Why Do I Need a T.O.C?]]).
757 When included, it creates a global JavaScript™ variable named
758 =org\_html\_manager=.
760 The =org\_html\_manager::setup()= function, that you will have to call
761 yourself (see examples in [[#setup][Setup]]), sets up a timeout function calling its
762 =init()= function after 50ms. After those 50 ms The =init()= function starts
763 its first attempt to scan the document, using the TOC as a guide. During
764 this scan the =org\_html\_manager= builds a tree of nodes, each caching some
765 data for later use. Once an element of the document is scanned it is marked by
766 setting a property =scanned\_for\_org= to =1=. This way it will not be scanned
767 a second time in subsquent runs (it will be checked though, but no work will
770 If the document (or the TOC) is not entirely loaded, =org\_html\_manager=
771 stops scanning, sets the timeout again to start an other scan 50 ms
772 later. Once the entire document is loaded and scanned no new timeout will be
773 set, and the document is displayed in the desired way (hopefully).
775 Once the number of attempts to scan the the document was configurable. This
776 was dropped, since we can not know in advance how fast the document will be
777 loaded on the client side.
779 The =org\_html\_manager= also changes the document a bit to make it react on
780 certain input events and follow your wishes. The old '/event handling/' was
781 entirely based on the normal link functions using so called =accesskeys=. This
782 has changed long ago, but the accesskeys will stay cause there is no reason to
785 * Presentations with org-info.js
787 The script can handle all the sections as single slides. Press '=x=' to switch
788 to the presentation mode. In this mode you may navigate the sections using the
789 mouse. Currently a single click moves forward and a doubleclick backwards
790 (will change this to right mouse button for backwards movement).
792 The first plain list (i.e. an <ul> element) in a section is special. The items
793 will be shown one by one when moving forward.
795 If you're at the end of the presentation, a click does not trigger a
796 warning. Same applies to a doubleclick when in the first section.
798 There is no plan to extend this feature set very much. A better plan might
799 be to write a separate tool to handle slides.
803 The aim of this little script was to implement a part of emacs Org-mode
804 facilities of folding. Oh, no - not originaly.
806 My first idea was to view some of my larger org files without scrolling. I
807 wanted to have them paged just like texinfo or linuxdoc files. In February
808 2008 I came across Carsten Dominik's /ideas/ page
809 [[https://orgmode.org/todo.html]]. And I could not resist to write him some of my
810 thoughts about this great emacs mode including some little ideas and
811 drawbacks. I don't know how, but somehow these guys made me, lazy bone that
812 I am, write this little script as an appetizer of /web 3.0 in Org-mode/ (Phil
815 I did and since some people really liked it, worked a bit more on it and added
816 features. Bastien Guerry was so kind to publish it on
817 http://www.legito.net/org-info-js/ the first months. Thanks Bastien.
819 In the first days of April Carsten Dominik added code to Org-mode to support
820 the usage of this script. Hence the script may now be configured in a similar way
821 to the other export options. Since then it is even possible to configure this
822 script through customize.
826 Very special thanks to Carsten Dominik, Bastien Guerry and Phil Jackson who
827 have encouraged me to write and publish this little piece of (unfinished) work
828 and all the hundreds of hours they spent on this fantastic emacs mode called
829 Org-mode and the export modules.
831 Org is a new working experience for me and there is nothing comparable to
832 working with emacs AND Org-mode.
834 Another big kiss to Gabi ([[http://www.emma-stil.de][www.emma-stil.de]]) for being so patient while I was
835 not working on our projects but playing with emacs.
837 Thanks to Tobias Prinz for listening to my stupid JavaScript questions and all
838 the usefull tips. Espacially the negative margin trick and key input.
840 And again big thanks to Carsten Dominik for making the inclusion and
841 configuration of the script so easy for the users, all the inspired ideas and
842 the great org radio table trick. A lot of the power of the final make up is
843 your merit! We all love to read the Org-mode mailing lists because of the
844 kind and relaxed tone that is yours.
846 Thanks a lot for OrgMode!
850 What I think about licenses? Well - I think licences and patents are not far
851 from each other. Poor people (and poor countries!!!) stay poor because of both
852 of them. But since I know where I live, in a world made of licenses and
853 patents, I have to apply some license to my work to protect it and stay
856 Hence the script was originally licensed under GPL 2. Since v.0.1.1.6 the
857 license was changed to [[http://www.gnu.org/licenses/old-licenses/gpl-2.0.html][GPL version 3]]. This document is subject to [[http://www.fsf.org/licensing/licenses/fdl.txt][GFDL]].
861 The original version of this document was written in emacs23 with Org-mode
862 v. 5.22a+. The visibilty of the contents of a individual section or
863 subsection can be toggled by clicking the stars in front of the headlines or
864 moving there and hitting =TAB=. The visibility of the entire document structure
865 can be changed by pressing =SHIFT+TAB= anywhere. When on a headline, pressing
866 =ALT+UP/DOWN= moves the entire subtree to different location in the tree,
867 keeping its level of indentation. =ALT+LEFT/RIGHT= promotes and demotes the
870 [[file:img/emacs23-org.js.org.png]]