diff --git a/.gitignore b/.gitignore
index 59ec847b..04f175ff 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,20 +2,21 @@
.DS_Store
*.swp
*.tmp
-*~
# Project files that should not be in the repo
-.*
-\#*
-!/.gitignore
+.project
+.settings/
+.settings.xml
+.settings
+.c9settings.xml
+.c9revisions
+.settings.xml.old
.*.gz
-*.tmTheme.js
# A handy place to put stuff that git should ignore:
/ignore/
node_modules/
-jam/
-* *
+tool/node_modules/
.git-ref
npm-debug.log
diff --git a/.gitmodules b/.gitmodules
index 07bbe371..4678c516 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
[submodule "doc/wiki"]
path = doc/wiki
- url = https://github.com/ajaxorg/ace.wiki.git
+ url = git://github.com/ajaxorg/ace.wiki.git
[submodule "build"]
path = build
- url = https://github.com/ajaxorg/ace-builds.git
+ url = git://github.com/ajaxorg/ace-builds.git
diff --git a/CNAME b/CNAME
deleted file mode 100644
index 75431b15..00000000
--- a/CNAME
+++ /dev/null
@@ -1 +0,0 @@
-ace.c9.io
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 062af59c..00000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,15 +0,0 @@
-Contributing
-------------
-
-Ace is a community project and wouldn't be what it is without contributions! We actively encourage and support contributions. The Ace source code is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!
-
-Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once.
-
-There are two versions of the agreement:
-
-1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
-2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects.
-
-If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it.
-
-Happy coding, Cloud9
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 3077d171..76b2313b 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,229 +1,3 @@
-Version 1.2.0-pre
-
-* New Features
- - Indented soft wrap (danyaPostfactum)
-
-* API Changes
- - unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745)
- - "change" event listeners on session and editor get delta objects directly
-
-2015.04.03 Version 1.1.9
-
- - Small Enhancements and Bugfixes
-
-2014.11.08 Version 1.1.8
-
-* API Changes
- - `editor.commands.commandKeyBinding` now contains direct map from keys to commands instead of grouping them by hashid
-
-* New Features
- - Improved autoindent for html and php modes (Adam Jimenez)
- - Find All from searchbox (Colton Voege)
-
-* new language modes
- - Elixir, Elm
-
-2014.09.21 Version 1.1.7
-
-* Bugfixes
- - fix several bugs in autocompletion
- - workaround for inaccurate getBoundingClientRect on chrome 37
-
-2014.08.17 Version 1.1.6
-
-* Bugfixes
- - fix regression in double tap to highlight
- - Improved Latex Mode (Daniel Felder)
-
-* API Changes
- - editor.destroy destroys editor.session too (call editor.setSession(null) to prevent that)
-
-* new language modes
- - Praat (José Joaquín Atria)
- - Eiffel (Victorien Elvinger)
- - G-code (Adam Joseph Cook)
-
-2014.07.09 Version 1.1.5
-
-* Bugfixes
- - fix regression in autocomplete popup
-
-* new language modes
- - gitignore (Devon Carew)
-
-2014.07.01 Version 1.1.4
-
-* New Features
- - Highlight matching tags (Adam Jimenez)
- - Improved jump to matching command (Adam Jimenez)
-
-* new language modes
- - AppleScript (Yaogang Lian)
- - Vala
-
-2014.03.08 Version 1.1.3
-
-* New Features
- - Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman)
- - Add ColdFusion behavior (Abram Adams)
- - add showLineNumbers option
- - Add html syntax checker (danyaPostfactum)
-
-* new language modes
- - Gherkin (Patrick Nevels)
- - Smarty
-
-2013.12.02 Version 1.1.2
-
-* New Features
- - Accessibility Theme for Ace (Peter Xiao)
- - use snipetManager for expanding emmet snippets
- - update jshint to 2.1.4
- - improve php syntax checker (jdalegonzalez)
- - add option for autoresizing
- - add option for autohiding vertical scrollbar
- - improvements to highlighting of xml like languages (danyaPostfactum)
- - add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
- - add option to merge similar changes in undo history
- - add scrollPastEnd option
- - use html5 dragndrop for text dragging (danyaPostfactum)
-
-* API Changes
- - fixed typo in HashHandler commmandManager
-
-* new language modes
- - Nix (Zef Hemel)
- - Protobuf (Zef Hemel)
- - Soy
- - Handlebars
-
-2013.06.04 Version 1.1.1
-
- - Improved emacs keybindings (Robert Krahn)
- - Added markClean, isClean methods to UndoManager (Joonsoo Jeon)
- - Do not allow `Toggle comments` command to remove spaces from indentation
- - Softer colors for indent guides in dark themes
-
-* new language modes
- - Ada
- - Assembly_x86
- - Cobol
- - D
- - ejs
- - MATLAB
- - MySQL
- - Twig
- - Verilog
-
-2013.05.01, Version 1.1.0
-
-* API Changes
- - Default position of the editor container is changed to relative. Add `.ace_editor {position: absolute}` css rule to restore old behavior
- - Changed default line-height to `normal` to not conflict with bootstrap. Use `line-height: inherit` for old behavior.
- - Changed marker types accepted by session.addMarker. It now accepts "text"|"line"|"fullLine"|"screenLine"
- - Internal classnames used by editor were made more consistent
- - Introduced `editor.setOption/getOption/setOptions/getOptions` methods
- - Introduced positionToIndex, indexToPosition methods
-
-* New Features
- - Improved emacs mode (chetstone)
- with Incremental search and Occur modes (Robert Krahn)
-
- - Improved ime handling
- - Searchbox (Vlad Zinculescu)
-
- - Added elastic tabstops lite extension (Garen Torikian)
- - Added extension for whitespace manipulation
- - Added extension for enabling spellchecking from contextmenu
- - Added extension for displaying available keyboard shortcuts (Matthew Christopher Kastor-Inare III)
- - Added extension for displaying options panel (Matthew Christopher Kastor-Inare III)
- - Added modelist extension (Matthew Christopher Kastor-Inare III)
-
- - Improved toggleCommentLines and added ToggleCommentBlock command
- - `:;` pairing in CSS mode (danyaPostfactum)
-
- - Added suppoert for Delete and SelectAll from context menu (danyaPostfactum)
-
- - Make wrapping behavior optional
- - Selective bracket insertion/skipping
-
- - Added commands for increase/decrease numbers, sort lines (Vlad Zinculescu)
- - Folding for Markdown, Lua, LaTeX
- - Selective bracket insertion/skipping for C-like languages
-
-* Many new languages
- - Scheme (Mu Lei)
- - Dot (edwardsp)
- - FreeMarker (nguillaumin)
- - Tiny Mushcode (h3rb)
- - Velocity (Ryan Griffith)
- - TOML (Garen Torikian)
- - LSL (Nemurimasu Neiro, Builders Brewery)
- - Curly (Libo Cannici)
- - vbScript (Jan Jongboom)
- - R (RStudio)
- - ABAP
- - Lucene (Graham Scott)
- - Haml (Garen Torikian)
- - Objective-C (Garen Torikian)
- - Makefile (Garen Torikian)
- - TypeScript (Garen Torikian)
- - Lisp (Garen Torikian)
- - Stylus (Garen Torikian)
- - Dart (Garen Torikian)
-
-* Live syntax checks
- - PHP (danyaPostfactum)
- - Lua
-
-* New Themes
- - Chaos
- - Terminal
-
-2012.09.17, Version 1.0.0
-
-* New Features
- - Multiple cursors and selections (https://c9.io/site/blog/2012/08/be-an-armenian-warrior-with-block-selection-on-steroids/)
- - Fold buttons displayed in the gutter
- - Indent Guides
- - Completely reworked vim mode (Sergi Mansilla)
- - Improved emacs keybindings
- - Autoclosing of html tags (danyaPostfactum)
-
-* 20 New language modes
- - Coldfusion (Russ)
- - Diff
- - GLSL (Ed Mackey)
- - Go (Davide Saurino)
- - Haxe (Jason O'Neil)
- - Jade (Garen Torikian)
- - jsx (Syu Kato)
- - LaTeX (James Allen)
- - Less (John Roepke)
- - Liquid (Bernie Telles)
- - Lua (Lee Gao)
- - LuaPage (Choonster)
- - Markdown (Chris Spencer)
- - PostgreSQL (John DeSoi)
- - Powershell (John Kane)
- - Sh (Richo Healey)
- - SQL (Jonathan Camile)
- - Tcl (Cristoph Hochreiner)
- - XQuery (William Candillion)
- - Yaml (Meg Sharkey)
-
- * Live syntax checks
- - for XQuery and JSON
-
-* New Themes
- - Ambiance (Irakli Gozalishvili)
- - Dreamweaver (Adam Jimenez)
- - Github (bootstraponline)
- - Tommorrow themes (https://github.com/chriskempson/tomorrow-theme)
- - XCode
-
-* Many Small Enhancements and Bugfixes
-
2011.08.02, Version 0.2.0
* Split view (Julian Viereck)
@@ -253,14 +27,15 @@ Version 1.2.0-pre
- SCAD (Jacob Hansson)
* Live syntax checks
- - Lint for CSS using CSS Lint
+ - Lint for Css using CSS Lint
- CoffeeScript
* New Themes
- Crimson Editor (iebuggy)
- Merbivore (Michael Schwartz)
- Merbivore soft (Michael Schwartz)
- - Solarized dark/light (David Alan Hjelle)
+ - Solarized dark/light (David Alan
+ Hjelle)
- Vibrant Ink (Michael Schwartz)
* Small Features/Enhancements
@@ -273,8 +48,10 @@ Version 1.2.0-pre
highlight are not affected (Irakli Gozalishvili)
- Added setFontSize method
- Improved vi keybindings (Trent Ogren)
- - When unfocused make cursor transparent instead of removing it (Harutyun Amirjanyan)
- - Support for matching groups in tokenizer with arrays of tokens (Chris Spencer)
+ - When unfocused make cursor transparent instead of removing it (Harutyun
+ Amirjanyan)
+ - Support for matching groups in tokenizer with arrays of tokens (Chris
+ Spencer)
* Bug fixes
- Add support for the new OSX scroll bars
@@ -282,7 +59,8 @@ Version 1.2.0-pre
- Proper handling of unicode characters in JavaScript identifiers
- Fix remove lines command on last line (Harutyun Amirjanyan)
- Fix scroll wheel sluggishness in Safari
- - Make keyboard infrastructure route keys like []^$ the right way (Julian Viereck)
+ - Make keyboard infrastructure route keys like []^$ the right way (Julian
+ Viereck)
2011.02.14, Version 0.1.6
@@ -335,4 +113,4 @@ Version 1.2.0-pre
* Add Ruby mode contributed by Shlomo Zalman Heigh
* Add Java mode contributed by Tom Tasche
* Fix annotation bug
-* Changing a document added a new empty line at the end
+* Changing a document added a new empty line at the end
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 4760be2a..853e4fd5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,24 +1,476 @@
-Copyright (c) 2010, Ajax.org B.V.
-All rights reserved.
+Licensed under the tri-license MPL/LGPL/GPL.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Ajax.org B.V. nor the
- names of its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+ Portions created by ______________________ are Copyright (C) ______
+ _______________________. All Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms
+ of the _____ license (the "[___] License"), in which case the
+ provisions of [______] License are applicable instead of those
+ above. If you wish to allow use of your version of this file only
+ under the terms of the [____] License and not to allow others to use
+ your version of this file under the MPL, indicate your decision by
+ deleting the provisions above and replace them with the notice and
+ other provisions required by the [___] License. If you do not delete
+ the provisions above, a recipient may use your version of this file
+ under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
+
+
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 29cf0495..1e781dab 100644
--- a/Makefile
+++ b/Makefile
@@ -13,21 +13,11 @@ pre_build:
build: pre_build
./Makefile.dryice.js normal
./Makefile.dryice.js demo
-
-# Minimal build: call Makefile.dryice.js only if our sources changed
-basic: build/src/ace.js
-
-build/src/ace.js : ${wildcard lib/*} \
- ${wildcard lib/*/*} \
- ${wildcard lib/*/*/*} \
- ${wildcard lib/*/*/*/*} \
- ${wildcard lib/*/*/*/*/*} \
- ${wildcard lib/*/*/*/*/*/*}
- ./Makefile.dryice.js
+ ./Makefile.dryice.js bm
doc:
cd doc;\
- (test -d node_modules && npm update) || npm install;\
+ test -d node_modules || npm install;\
node build.js
clean:
diff --git a/Makefile.dryice.js b/Makefile.dryice.js
index 0ce7c657..b508f2f0 100755
--- a/Makefile.dryice.js
+++ b/Makefile.dryice.js
@@ -1,54 +1,58 @@
#!/usr/bin/env node
/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * The Original Code is Ajax.org Code Editor (ACE).
*
+ * The Initial Developer of the Original Code is
+ * Ajax.org B.V.
+ * Portions created by the Initial Developer are Copyright (C) 2010
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Fabian Jakobs
+ * Julian Viereck
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
* ***** END LICENSE BLOCK ***** */
var fs = require("fs");
-var path = require("path");
-var copy = require('architect-build/copy');
-var build = require('architect-build/build');
+if (!fs.existsSync)
+ fs.existsSync = require("path").existsSync;
+var copy = require('dryice').copy;
var ACE_HOME = __dirname;
var BUILD_DIR = ACE_HOME + "/build";
-var CACHE = {};
function main(args) {
- if (args.indexOf("updateModes") !== -1) {
- return updateModes();
- }
var type = "minimal";
args = args.map(function(x) {
if (x[0] == "-" && x[1] != "-")
return "-" + x;
return x;
- }).filter(Boolean);
-
+ });
+
if (args[2] && (args[2][0] != "-" || args[2].indexOf("h") != -1))
type = args[2];
@@ -56,71 +60,119 @@ function main(args) {
if (i != -1 && args[i+1])
BUILD_DIR = args[i+1];
- if (args.indexOf("--h") == -1) {
- if (type == "minimal") {
- buildAce({
- compress: args.indexOf("--m") != -1,
- noconflict: args.indexOf("--nc") != -1,
- shrinkwrap: args.indexOf("--s") != -1
- });
- } else if (type == "normal") {
- ace();
- } else if (type == "demo") {
- demo();
- } else if (type == "full") {
- ace();
- demo();
- } else if (type == "highlighter") {
- // TODO
- }
+ if (type == "minimal") {
+ buildAce({
+ compress: args.indexOf("--m") != -1,
+ noconflict: args.indexOf("--nc") != -1
+ });
+ } else if (type == "normal") {
+ ace();
+ } else if (type == "demo") {
+ demo();
+ } else if (type == "bm") {
+ bookmarklet();
+ } else if (type == "full") {
+ ace();
+ demo();
+ bookmarklet();
}
-}
-
-function showHelp(type) {
+
console.log("--- Ace Dryice Build Tool ---");
console.log("");
console.log("Options:");
- console.log(" minimal Places necessary Ace files out in build dir; uses configuration flags below [default]");
- console.log(" normal Runs four Ace builds--minimal, minimal-noconflict, minimal-min, and minimal-noconflict-min");
- console.log(" demo Runs demo build of Ace");
- console.log(" full all of above");
- console.log(" highlighter ");
- console.log("args:");
- console.log(" --target ./path path to build folder");
+ console.log(" normal Runs embedded build of Ace");
+ console.log(" demo Runs demo build of Ace");
+ console.log(" bm Runs bookmarklet build of Ace");
+ console.log(" full all of above");
console.log("flags:");
- console.log(" --h print this help");
- console.log(" --m minify");
- console.log(" --nc namespace require");
- console.log(" --s shrinkwrap (combines all output files into one)");
+ console.log(" -m minify");
+ console.log(" -nc namespace require");
+ console.log(" --target ./path path to build folder");
console.log("");
- if (type)
- console.log(" output for " + type + " generated in " + BUILD_DIR);
+ if (BUILD_DIR)
+ console.log(" output generated in " + type + __dirname + "/" + BUILD_DIR)
+
+ process.exit(0);
+
+}
+
+function bookmarklet() {
+ var targetDir = BUILD_DIR + "/textarea";
+ copy({
+ source: "build_support/editor_textarea.html",
+ dest: targetDir + '/editor.html'
+ });
+ copy({
+ source: "build_support/style.css",
+ dest: targetDir + '/style.css'
+ });
+
+ buildAce({
+ targetDir: targetDir + "/src",
+ ns: "__ace_shadowed__",
+ exportModule: "ace/ext/textarea",
+ compress: false,
+ noconflict: true,
+ suffix: "",
+ name: "ace-bookmarklet",
+ workers: [],
+ keybindings: []
+ });
}
function ace() {
+ console.log('# ace ---------');
+
+ // uncompressed
+ buildAce({
+ compress: false,
+ noconflict: false
+ });
+ buildAce({
+ compress: false,
+ noconflict: true
+ });
+
+ // compressed
+ buildAce({
+ compress: true,
+ noconflict: false
+ });
+ buildAce({
+ compress: true,
+ noconflict: true
+ });
+
console.log('# ace License | Readme | Changelog ---------');
- copy.file(ACE_HOME + "/build_support/editor.html", BUILD_DIR + "/editor.html");
- copy.file(ACE_HOME + "/LICENSE", BUILD_DIR + "/LICENSE");
- copy.file(ACE_HOME + "/ChangeLog.txt", BUILD_DIR + "/ChangeLog.txt");
-
- console.log('# ace ---------');
- for (var i = 0; i < 4; i++)
- buildAce({compress: i & 2, noconflict: i & 1});
+ copy({
+ source: ACE_HOME + "/build_support/editor.html",
+ dest: BUILD_DIR + "/editor.html"
+ });
+ copy({
+ source: ACE_HOME + "/LICENSE",
+ dest: BUILD_DIR + "/LICENSE"
+ });
+ copy({
+ source: ACE_HOME + "/ChangeLog.txt",
+ dest: BUILD_DIR + "/ChangeLog.txt"
+ });
}
function demo() {
console.log('# kitchen sink ---------');
- var version = "", ref = "";
+ var version, ref;
try {
version = JSON.parse(fs.readFileSync(ACE_HOME + "/package.json")).version;
ref = fs.readFileSync(ACE_HOME + "/.git-ref").toString();
- } catch(e) {}
+ } catch(e) {
+ ref = "";
+ version = "";
+ }
function changeComments(data) {
return (data
- .replace("doc/site/images/ace-logo.png", "demo/kitchen-sink/ace-logo.png")
.replace(//g, "")
.replace(/PACKAGE\-\->|")}
- function script(str) {result.push('')}
- scripts.forEach(function(s) {
- s = s.replace(/"/g, "");
- if (s == "ace/ace") {
- comment("load ace");
- script("ace");
- } else {
- var extName = s.match(/[^/]*$/)[0];
- comment("load ace " + extName + " extension");
- script("ext-" + extName);
- }
- });
- result.push("
```
-The mode can then be used like this:
+Then the mode can be used like this:
```javascript
- var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
+ var JavaScriptMode = require("ace/mode/javascript").Mode;
editor.getSession().setMode(new JavaScriptMode());
```
+and take a look at the one of [included](https://github.com/ajaxorg/ace-builds/blob/master/editor.html) [demos](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js) of how to use Ace.
+
Documentation
-------------
-Additional usage information, including events to listen to and extending syntax highlighters, can be found [on the main Ace website](http://ace.c9.io).
+You can find api documentation at [http://ajaxorg.github.com/ace/api/index.html](http://ajaxorg.github.com/ace/api/index.html).
-You can also find API documentation at [http://ace.c9.io/#nav=api](http://ace.c9.io/#nav=api).
+And a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js).
-Also check out the sample code for the kitchen sink [demo app](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js).
+There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki).
-If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss), or at `irc.freenode.net#ace`.
+If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss).
Running Ace
-----------
-After the checkout Ace works out of the box. No build step is required. To try it out, simply start the bundled mini HTTP server:
+After the checkout Ace works out of the box. No build step is required. To open editor with a file:/// URL see [wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file:---). Or Simply start bundled mini HTTP server:
```bash
./static.py
@@ -112,31 +120,16 @@ Or using Node.JS
The editor can then be opened at http://localhost:8888/kitchen-sink.html.
-To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file).
-
-Building Ace
+Package Ace
-----------
-You do not generally need to build ACE. The [ace-builds repository](https://github.com/ajaxorg/ace-builds/) endeavours to maintain the latest build, and you can just copy one of _src*_ subdirectories somewhere into your project.
-
-However, all you need is Node.js and npm installed to package ACE. Just run `npm install` in the ace folder to install dependencies:
+To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. (see the [wiki](https://github.com/ajaxorg/ace/wiki/Building-ace) for more details)
```bash
npm install
node ./Makefile.dryice.js
```
-To package Ace, we use the dryice build tool developed by the Mozilla Skywriter team. Call `node Makefile.dryice.js` on the command-line to start the packing. This build script accepts the following options
-
-```bash
--m minify build files with uglify-js
--nc namespace require and define calls with "ace"
--bm builds the bookmarklet version
---target ./path specify relative path for output folder (default value is "./build")
-```
-
-To generate all the files in the ace-builds repository, run `node Makefile.dryice.js full --target ../ace-builds`
-
Running the Unit Tests
----------------------
@@ -152,17 +145,27 @@ You can also run the tests in your browser by serving:
This makes debugging failing tests way more easier.
-Contributing
------------------------------
-
-Ace is a community project and wouldn't be what it is without contributions! We actively encourage and support contributions. The Ace source code is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings!
-
-Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. For more information on our contributing guidelines, see [CONTRIBUTING.md](https://github.com/ajaxorg/ace/blob/master/CONTRIBUTING.md).
-
Continuous Integration status
-----------------------------
This project is tested with [Travis CI](http://travis-ci.org)
-[](http://travis-ci.org/ajaxorg/ace)
+[](http://travis-ci.org/ajaxorg/ace)
+Contributing
+------------
+Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement:
+
+1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting.
+2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects
+
+If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email.
+
+Email: fabian.jakobs@web.de
+
+Fax: +31 (0) 206388953
+
+Address: Ajax.org B.V.
+ Keizersgracht 241
+ 1016 EA, Amsterdam
+ the Netherlands
\ No newline at end of file
diff --git a/api/ace.html b/api/ace.html
index c0f40b1d..db3f017e 100644
--- a/api/ace.html
+++ b/api/ace.html
@@ -1,149 +1,14 @@
+
+
+
+ Ace - Ace API
Fires whenever the anchor position changes. Events that can trigger this function include 'insertText', 'insertLines', 'removeText', and 'removeLines'.
+
Fires whenever the anchor position changes. Events that can trigger this function include 'insertText', 'insertLines', 'removeText', and 'removeLines'.
Tokenizes the current Document in the background, and caches the tokenized rows for future use. If a certain row is changed, everything below that row is re-tokenized.
Contains the text of the document. Document can be attached to several EditSessions. At its core, Documents are just an array of strings, with each row in the document matching up to the array index.
Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.
-
-
-
Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()); otherwise it's simply '\t'.
-
-
-
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()); otherwise it's simply '\t'.
Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start () to all the rows; it also emits the 'tokenizerUpdate' event.
-
-
-
Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start () to all the rows; it also emits the 'tokenizerUpdate' event.
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.
-
-
-
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
-
-
-
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
Pass in true to enable overwrites in your session, or false to disable.
-
-
-
Pass in true to enable overwrites in your session, or false to disable.
-
If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.
-
-
-
Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.
EditSession.setWrapLimitRange(Number min, Number max)
-
-
-
-
-
-
-
-
Sets the boundaries of wrap. Either value can be null to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min or max are different, this method also emits the 'changeWrapMode' event.
-
-
-
Sets the boundaries of wrap. Either value can be null to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min or max are different, this method also emits the 'changeWrapMode' event.
Stores all the data about Editor state providing easy way to change editors state. EditSession can be attached to only one Document. Same Document can be attached to several EditSessions.
Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.
+
Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize); otherwise it's simply '\t'.
+
Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize); otherwise it's simply '\t'.
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.
+
Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
+
Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.
Sets a new text mode for the EditSession. This method also emits the 'changeMode' event. If a BackgroundTokenizer is set, the 'tokenizerUpdate' event is also emitted.
+
Sets a new text mode for the EditSession. This method also emits the 'changeMode' event. If a BackgroundTokenizer is set, the 'tokenizerUpdate' event is also emitted.
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
+
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.
+
Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.
EditSession.setWrapLimitRange(Number min, Number max)
Sets the boundaries of wrap. Either value can be null to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min or max are different, this method also emits the 'changeWrapMode' event.
+
Sets the boundaries of wrap. Either value can be null to have an unconstrained wrap, or, they can be the same number to pin the limit. If the wrap limits for min or max are different, this method also emits the 'changeWrapMode' event.
Required. An object which contains one property, text, that represents the text to be pasted. Editing this property will alter the text that is pasted.
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
-
-
-
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
-
-
-
Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
-
-
-
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets
-when such a character is typed in.
-
-
-
Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets
-when such a character is typed in.
The main entry point into the Ace functionality. The Editor manages the EditSession (which manages Documents), as well as the VirtualRenderer, which draws everything to the screen. Event sessions dealing with the mouse and keyboard are bubbled up from Document to the Editor, which decides what to do with them.
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
+
Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
+
Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
+
Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.
Welcome to the Ace API Reference Guide. Ace is a standalone code editor written in JavaScript that you can embed onto any website. We're used in a bunch of places already, like GitHub, Google, and Facebook.
On the left, you'll find a list of all of our currently documented classes. There are plenty more to do, but these represent the "core" set. For more information on how to work with Ace, check out the main Ace website.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api/placeholder.html b/api/placeholder.html
index fa12a958..627e7abf 100644
--- a/api/placeholder.html
+++ b/api/placeholder.html
@@ -1,293 +1,28 @@
+
+
+
+ PlaceHolder - Ace API
Hides all over markers in the EditSession that are not the currently selected one.
+
Hides all over markers in the EditSession that are not the currently selected one.
+
PlaceHolder.setup()
TODO
+
TODO
+
PlaceHolder.showOtherMarkers()
TODO
+
TODO
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api/range.html b/api/range.html
index 9779fe27..d37137e4 100644
--- a/api/range.html
+++ b/api/range.html
@@ -1,968 +1,67 @@
+
+
+
+ Range - Ace API
This object is used in various places to indicate a region within the editor. To better visualize how this works, imagine a rectangle. Each quadrant of the rectangle is analogus to a range, as ranges contain a starting row and starting column, and an ending row, and ending column.
a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
t
",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
+
Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
+
Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.
Contains the cursor position and the text selection of an edit session.
-
The row/columns used in the selection are in document coordinates representing the coordinates as they appear in the document before applying soft wrap and folding.
Selection.moveCursorTo(Number row, Number column, Boolean keepDesiredColumn)
-
-
-
-
-
-
-
-
Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
-
-
-
Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
Selection.moveCursorToScreen(Number row, Number column, Boolean keepDesiredColumn)
-
-
-
-
-
-
-
-
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
-
-
-
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
Contains the cursor position and the text selection of an edit session.
+
The row/columns used in the selection are in document coordinates representing ths coordinates as thez appear in the document before applying soft wrap and folding.
Selection.moveCursorTo(Number row, Number column, Boolean keepDesiredColumn)
Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
+
Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
Selection.moveCursorToScreen(Number row, Number column, Boolean keepDesiredColumn)
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
+
Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.
Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.
+
Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/api/tokenizer.html b/api/tokenizer.html
index b45bd58d..de974f6b 100644
--- a/api/tokenizer.html
+++ b/api/tokenizer.html
@@ -1,122 +1,16 @@
+
+
+
+ Tokenizer - Ace API
Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-
-
-
Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
-
-
-
Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
+
Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
+
Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.
+ani
+
+
+
+
diff --git a/demo/ipad.js b/demo/ipad.js
new file mode 100644
index 00000000..45da8861
--- /dev/null
+++ b/demo/ipad.js
@@ -0,0 +1,72 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Skywriter.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Fabian Jakobs
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+
+define(function(require, exports, module) {
+
+var Dom = require("ace/lib/dom");
+var Event = require("ace/lib/event");
+
+var Editor = require("ace/editor").Editor;
+var EditSession = require("ace/edit_session").EditSession;
+var UndoManager = require("ace/undomanager").UndoManager;
+var Renderer = require("ace/virtual_renderer").VirtualRenderer;
+var JavaScriptMode = require("ace/mode/javascript").Mode;
+
+exports.launch = function(el, text) {
+ if (typeof(el) == "string") {
+ el = document.getElementById(el);
+ }
+
+ editor = new Editor(new Renderer(el, "ace/theme/twilight"));
+
+ var doc = new EditSession(text);
+ doc.setMode(new JavaScriptMode());
+ doc.setUndoManager(new UndoManager());
+ editor.setSession(doc);
+
+ editor.resize();
+
+ /* setTimeout(function(){
+ editor.setAnimatedScroll(true)
+ editor.renderer.scrollToLine(editor.renderer.scrollTop == 0 ? 200 :0 ,0,true)
+ }, 2000);*/
+
+ return editor;
+};
+
+});
\ No newline at end of file
diff --git a/demo/keyboard_shortcuts.html b/demo/keyboard_shortcuts.html
deleted file mode 100644
index 3d01f559..00000000
--- a/demo/keyboard_shortcuts.html
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
- Editor
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js
index 33b2dbc0..88a2ca25 100644
--- a/demo/kitchen-sink/demo.js
+++ b/demo/kitchen-sink/demo.js
@@ -1,30 +1,39 @@
/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * The Original Code is Mozilla Skywriter.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * Fabian Jakobs
+ * Kevin Dangoor (kdangoor@mozilla.com)
+ * Julian Viereck
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
@@ -33,15 +42,7 @@ define(function(require, exports, module) {
"use strict";
require("ace/lib/fixoldbrowsers");
-
-require("ace/multi_select");
-require("ace/ext/spellcheck");
-require("./inline_editor");
-require("./dev_util");
-require("./file_drop");
-
-var config = require("ace/config");
-config.init();
+require("ace/config").init();
var env = {};
var dom = require("ace/lib/dom");
@@ -54,38 +55,211 @@ var theme = require("ace/theme/textmate");
var EditSession = require("ace/edit_session").EditSession;
var UndoManager = require("ace/undomanager").UndoManager;
+var vim = require("ace/keyboard/vim").handler;
+var emacs = require("ace/keyboard/emacs").handler;
var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
var Renderer = require("ace/virtual_renderer").VirtualRenderer;
var Editor = require("ace/editor").Editor;
+var MultiSelect = require("ace/multi_select").MultiSelect;
-var whitespace = require("ace/ext/whitespace");
+// workers do not work for file:
+if (location.protocol == "file:")
+ EditSession.prototype.$useWorker = false;
+/************** modes ***********************/
+var modes = [];
+function getModeFromPath(path) {
+ var mode = modesByName.text;
+ for (var i = 0; i < modes.length; i++) {
+ if (modes[i].supportsFile(path)) {
+ mode = modes[i];
+ break;
+ }
+ }
+ return mode;
+};
+var Mode = function(name, desc, extensions) {
+ this.name = name;
+ this.desc = desc;
+ this.mode = "ace/mode/" + name;
+ this.extRe = new RegExp("^.*\\.(" + extensions + ")$", "g");
+};
-var doclist = require("./doclist");
-var modelist = require("ace/ext/modelist");
-var themelist = require("ace/ext/themelist");
-var layout = require("./layout");
-var TokenTooltip = require("./token_tooltip").TokenTooltip;
-var util = require("./util");
-var saveOption = util.saveOption;
-var fillDropdown = util.fillDropdown;
-var bindCheckbox = util.bindCheckbox;
-var bindDropdown = util.bindDropdown;
+Mode.prototype.supportsFile = function(filename) {
+ return filename.match(this.extRe);
+};
-var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
+var modesByName = {
+ c9search: ["C9Search" , "c9search_results"],
+ coffee: ["CoffeeScript" , "coffee|^Cakefile"],
+ coldfusion: ["ColdFusion" , "cfm"],
+ csharp: ["C#" , "cs"],
+ css: ["CSS" , "css"],
+ diff: ["Diff" , "diff|patch"],
+ glsl: ["Glsl" , "glsl|frag|vert"],
+ golang: ["Go" , "go"],
+ groovy: ["Groovy" , "groovy"],
+ haxe: ["haXe" , "hx"],
+ html: ["HTML" , "htm|html|xhtml"],
+ c_cpp: ["C/C++" , "c|cc|cpp|cxx|h|hh|hpp"],
+ clojure: ["Clojure" , "clj"],
+ java: ["Java" , "java"],
+ javascript: ["JavaScript" , "js"],
+ json: ["JSON" , "json"],
+ jsx: ["JSX" , "jsx"],
+ latex: ["LaTeX" , "latex|tex|ltx|bib"],
+ less: ["LESS" , "less"],
+ liquid: ["Liquid" , "liquid"],
+ lua: ["Lua" , "lua"],
+ luapage: ["LuaPage" , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates
+ markdown: ["Markdown" , "md|markdown"],
+ ocaml: ["OCaml" , "ml|mli"],
+ perl: ["Perl" , "pl|pm"],
+ pgsql: ["pgSQL" , "pgsql"],
+ php: ["PHP" , "php|phtml"],
+ powershell: ["Powershell" , "ps1"],
+ python: ["Python" , "py"],
+ ruby: ["Ruby" , "ru|gemspec|rake|rb"],
+ scad: ["OpenSCAD" , "scad"],
+ scala: ["Scala" , "scala"],
+ scss: ["SCSS" , "scss|sass"],
+ sh: ["SH" , "sh|bash|bat"],
+ sql: ["SQL" , "sql"],
+ svg: ["SVG" , "svg"],
+ tcl: ["Tcl" , "tcl"],
+ text: ["Text" , "txt"],
+ textile: ["Textile" , "textile"],
+ xml: ["XML" , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
+ xquery: ["XQuery" , "xq"],
+ yaml: ["YAML" , "yaml"]
+};
-var IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
-
-
-var workerModule = require("ace/worker/worker_client");
-if (location.href.indexOf("noworker") !== -1) {
- workerModule.WorkerClient = workerModule.UIWorkerClient;
+for (var name in modesByName) {
+ var mode = modesByName[name];
+ mode = new Mode(name, mode[0], mode[1])
+ modesByName[name] = mode;
+ modes.push(mode);
}
+
+/*********** demo documents ***************************/
+var fileCache = {};
+
+function initDoc(file, path, doc) {
+ if (doc.prepare)
+ file = doc.prepare(file);
+
+ var session = new EditSession(file);
+ session.setUndoManager(new UndoManager());
+ doc.session = session;
+ doc.path = path;
+ if (doc.wrapped) {
+ session.setUseWrapMode(true);
+ session.setWrapLimitRange(80, 80);
+ }
+ var mode = getModeFromPath(path)
+ session.modeName = mode.name;
+ session.setMode(mode.mode);
+}
+
+
+function makeHuge(txt) {
+ for (var i = 0; i < 5; i++)
+ txt += txt;
+ return txt
+}
+
+var docs = {
+ "docs/javascript.js": "JavaScript",
+ "docs/clojure.clj": "Clojure",
+ "docs/coffeescript.coffee": "Coffeescript",
+ "docs/coldfusion.cfm": "ColdFusion",
+ "docs/cpp.cpp": "C/C++",
+ "docs/csharp.cs": "C#",
+ "docs/css.css": "CSS",
+ "docs/diff.diff": "Diff",
+ "docs/glsl.glsl": "Glsl",
+ "docs/golang.go": "Go",
+ "docs/groovy.groovy": "Groovy",
+ "docs/Haxe.hx": "haXe",
+ "docs/html.html": "HTML",
+ "docs/java.java": "Java",
+ "docs/json.json": "JSON",
+ "docs/jsx.jsx": "JSX",
+ "docs/latex.tex": {name: "LaTeX", wrapped: true},
+ "docs/less.less": "LESS",
+ "docs/liquid.liquid": "Liquid",
+ "docs/lua.lua": "Lua",
+ "docs/luapage.lp": "LuaPage",
+ "docs/markdown.md": {name: "Markdown", wrapped: true},
+ "docs/ocaml.ml": "OCaml",
+ "docs/OpenSCAD.scad": "OpenSCAD",
+ "docs/perl.pl": "Perl",
+ "docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
+ "docs/php.php": "PHP",
+ "docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
+ "docs/powershell.ps1": "Powershell",
+ "docs/python.py": "Python",
+ "docs/ruby.rb": "Ruby",
+ "docs/scala.scala": "Scala",
+ "docs/scss.scss": "SCSS",
+ "docs/sh.sh": "SH",
+ "docs/sql.sql": {name: "SQL", wrapped: true},
+ "docs/svg.svg": "SVG",
+ "docs/tcl.tcl": "Tcl",
+ "docs/textile.textile": {name: "Textile", wrapped: true},
+ "docs/xml.xml": "XML",
+ "docs/xquery.xq": "XQuery",
+ "docs/yaml.yaml": "YAML",
+ "docs/c9search.c9search_results": "C9 Search Results"
+}
+
+var ownSource = {
+ /* filled from require*/
+};
+
+var hugeDocs = {
+ "build/src/ace.js": "",
+ "build/src-min/ace.js": ""
+};
+
+if (window.require && window.require.s) try {
+ for (var path in window.require.s.contexts._.loaded) {
+ if (path.indexOf("!") != -1)
+ path = path.split("!").pop();
+ else
+ path = path + ".js";
+ ownSource[path] = ""
+ }
+} catch(e) {}
+
+function prepareDocList(docs) {
+ var list = []
+ for (var path in docs) {
+ var doc = docs[path];
+ if (typeof doc != "object")
+ doc = {name: doc || path};
+
+ doc.path = path;
+ doc.desc = doc.name.replace(/^(ace|docs|demo|build)\//, "");
+ if (doc.desc.length > 18)
+ doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9)
+
+ fileCache[doc.name] = doc;
+ list.push(doc);
+ };
+
+ return list;
+}
+
+docs = prepareDocList(docs);
+ownSource = prepareDocList(ownSource);
+hugeDocs = prepareDocList(hugeDocs);
+
/*********** create editor ***************************/
-var container = document.getElementById("editor-container");
+var container = document.getElementById("editor");
// Splitting.
var Split = require("ace/split").Split;
@@ -97,35 +271,30 @@ split.on("focus", function(editor) {
});
env.split = split;
window.env = env;
-
+window.ace = env.editor;
+env.editor.setAnimatedScroll(true);
var consoleEl = dom.createElement("div");
container.parentNode.appendChild(consoleEl);
-consoleEl.style.cssText = "position:fixed; bottom:1px; right:0;\
-border:1px solid #baf; z-index:100";
-
-var cmdLine = new layout.singleLineEditor(consoleEl);
+consoleEl.style.position="fixed"
+consoleEl.style.bottom = "1px"
+consoleEl.style.right = 0
+consoleEl.style.background = "white"
+consoleEl.style.border = "1px solid #baf"
+consoleEl.style.zIndex = "100"
+var cmdLine = new singleLineEditor(consoleEl);
cmdLine.editor = env.editor;
env.editor.cmdLine = cmdLine;
-env.editor.showCommandLine = function(val) {
- this.cmdLine.focus();
- if (typeof val == "string")
- this.cmdLine.setValue(val, 1);
-};
-
-/**
- * This demonstrates how you can define commands and bind shortcuts to them.
- */
env.editor.commands.addCommands([{
name: "gotoline",
bindKey: {win: "Ctrl-L", mac: "Command-L"},
exec: function(editor, line) {
if (typeof line == "object") {
var arg = this.name + " " + editor.getCursorPosition().row;
- editor.cmdLine.setValue(arg, 1);
- editor.cmdLine.focus();
- return;
+ editor.cmdLine.setValue(arg, 1)
+ editor.cmdLine.focus()
+ return
}
line = parseInt(line, 10);
if (!isNaN(line))
@@ -133,128 +302,54 @@ env.editor.commands.addCommands([{
},
readOnly: true
}, {
- name: "snippet",
- bindKey: {win: "Alt-C", mac: "Command-Alt-C"},
+ name: "find",
+ bindKey: {win: "Ctrl-F", mac: "Command-F"},
exec: function(editor, needle) {
if (typeof needle == "object") {
- editor.cmdLine.setValue("snippet ", 1);
- editor.cmdLine.focus();
- return;
+ var arg = this.name + " " + editor.getCopyText()
+ editor.cmdLine.setValue(arg, 1)
+ editor.cmdLine.focus()
+ return
}
- var s = snippetManager.getSnippetByName(needle, editor);
- if (s)
- snippetManager.insertSnippet(editor, s.content);
+ editor.find(needle);
},
readOnly: true
}, {
name: "focusCommandLine",
- bindKey: "shift-esc|ctrl-`",
+ bindKey: "shift-esc",
exec: function(editor, needle) { editor.cmdLine.focus(); },
readOnly: true
-}, {
- name: "nextFile",
- bindKey: "Ctrl-tab",
- exec: function(editor) { doclist.cycleOpen(editor, 1); },
- readOnly: true
-}, {
- name: "previousFile",
- bindKey: "Ctrl-shift-tab",
- exec: function(editor) { doclist.cycleOpen(editor, -1); },
- readOnly: true
-}, {
- name: "execute",
- bindKey: "ctrl+enter",
- exec: function(editor) {
- try {
- var r = window.eval(editor.getCopyText() || editor.getValue());
- } catch(e) {
- r = e;
- }
- editor.cmdLine.setValue(r + "");
- },
- readOnly: true
-}, {
- name: "showKeyboardShortcuts",
- bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
- exec: function(editor) {
- config.loadModule("ace/ext/keybinding_menu", function(module) {
- module.init(editor);
- editor.showKeyboardShortcuts();
- });
- }
-}, {
- name: "increaseFontSize",
- bindKey: "Ctrl-=|Ctrl-+",
- exec: function(editor) {
- var size = parseInt(editor.getFontSize(), 10) || 12;
- editor.setFontSize(size + 1);
- }
-}, {
- name: "decreaseFontSize",
- bindKey: "Ctrl+-|Ctrl-_",
- exec: function(editor) {
- var size = parseInt(editor.getFontSize(), 10) || 12;
- editor.setFontSize(Math.max(size - 1 || 1));
- }
-}, {
- name: "resetFontSize",
- bindKey: "Ctrl+0|Ctrl-Numpad0",
- exec: function(editor) {
- editor.setFontSize(12);
- }
-}]);
-
-
-env.editor.commands.addCommands(whitespace.commands);
+}])
cmdLine.commands.bindKeys({
- "Shift-Return|Ctrl-Return|Alt-Return": function(cmdLine) { cmdLine.insert("\n"); },
+ "Shift-Return|Ctrl-Return|Alt-Return": function(cmdLine) { cmdLine.insert("\n")},
"Esc|Shift-Esc": function(cmdLine){ cmdLine.editor.focus(); },
"Return": function(cmdLine){
var command = cmdLine.getValue().split(/\s+/);
var editor = cmdLine.editor;
editor.commands.exec(command[0], editor, command[1]);
editor.focus();
- }
-});
+ },
+})
-cmdLine.commands.removeCommands(["find", "gotoline", "findall", "replace", "replaceall"]);
+cmdLine.commands.removeCommands(["find", "gotoline", "findall", "replace", "replaceall"])
+
+/**
+ * This demonstrates how you can define commands and bind shortcuts to them.
+ */
var commands = env.editor.commands;
commands.addCommand({
name: "save",
bindKey: {win: "Ctrl-S", mac: "Command-S"},
- exec: function(arg) {
- var session = env.editor.session;
- var name = session.name.match(/[^\/]+$/);
- localStorage.setItem(
- "saved_file:" + name,
- session.getValue()
- );
- env.editor.cmdLine.setValue("saved "+ name);
- }
-});
-
-commands.addCommand({
- name: "load",
- bindKey: {win: "Ctrl-O", mac: "Command-O"},
- exec: function(arg) {
- var session = env.editor.session;
- var name = session.name.match(/[^\/]+$/);
- var value = localStorage.getItem("saved_file:" + name);
- if (typeof value == "string") {
- session.setValue(value);
- env.editor.cmdLine.setValue("loaded "+ name);
- } else {
- env.editor.cmdLine.setValue("no previuos value saved for "+ name);
- }
- }
+ exec: function() {alert("Fake Save File");}
});
var keybindings = {
- ace: null, // Null = use "default" keymapping
- vim: require("ace/keyboard/vim").handler,
- emacs: "ace/keyboard/emacs",
+ // Null = use "default" keymapping
+ ace: null,
+ vim: vim,
+ emacs: emacs,
// This is a way to define simple keyboard remappings
custom: new HashHandler({
"gotoright": "Tab",
@@ -262,28 +357,28 @@ var keybindings = {
"outdent": "[",
"gotolinestart": "^",
"gotolineend": "$"
- })
+ })
};
/*********** manage layout ***************************/
-var consoleHeight = 20;
+var consoleHight = 20;
function onResize() {
var left = env.split.$container.offsetLeft;
var width = document.documentElement.clientWidth - left;
container.style.width = width + "px";
- container.style.height = document.documentElement.clientHeight - consoleHeight + "px";
+ container.style.height = document.documentElement.clientHeight - consoleHight + "px";
env.split.resize();
consoleEl.style.width = width + "px";
- cmdLine.resize();
+ cmdLine.resize()
}
window.onresize = onResize;
onResize();
-/*********** options panel ***************************/
+/*********** options pane ***************************/
var docEl = document.getElementById("doc");
var modeEl = document.getElementById("mode");
var wrapModeEl = document.getElementById("soft_wrap");
@@ -296,58 +391,60 @@ var showGutterEl = document.getElementById("show_gutter");
var showPrintMarginEl = document.getElementById("show_print_margin");
var highlightSelectedWordE = document.getElementById("highlight_selected_word");
var showHScrollEl = document.getElementById("show_hscroll");
-var showVScrollEl = document.getElementById("show_vscroll");
var animateScrollEl = document.getElementById("animate_scroll");
var softTabEl = document.getElementById("soft_tab");
var behavioursEl = document.getElementById("enable_behaviours");
-fillDropdown(docEl, doclist.all);
+var group = document.createElement("optgroup");
+group.setAttribute("label", "Mode Examples");
+fillDropdown(docs, group);
+docEl.appendChild(group);
+var group = document.createElement("optgroup");
+group.setAttribute("label", "Huge documents");
+fillDropdown(hugeDocs, group);
+docEl.appendChild(group);
+var group = document.createElement("optgroup");
+group.setAttribute("label", "own source");
+fillDropdown(ownSource, group);
+docEl.appendChild(group);
+
+
+fillDropdown(modes, modeEl);
-fillDropdown(modeEl, modelist.modes);
-var modesByName = modelist.modesByName;
bindDropdown("mode", function(value) {
- env.editor.session.setMode(modesByName[value].mode || modesByName.text.mode);
- env.editor.session.modeName = value;
+ env.editor.getSession().setMode(modesByName[value].mode || modesByName.text.mode);
+ env.editor.getSession().modeName = value;
});
-doclist.history = doclist.docs.map(function(doc) {
- return doc.name;
-});
-doclist.history.index = 0;
-doclist.cycleOpen = function(editor, dir) {
- var h = this.history;
- h.index += dir;
- if (h.index >= h.length)
- h.index = 0;
- else if (h.index <= 0)
- h.index = h.length - 1;
- var s = h[h.index];
- docEl.value = s;
- docEl.onchange();
-};
-doclist.addToHistory = function(name) {
- var h = this.history;
- var i = h.indexOf(name);
- if (i != h.index) {
- if (i != -1)
- h.splice(i, 1);
- h.index = h.push(name);
- }
-};
-
bindDropdown("doc", function(name) {
- doclist.loadDoc(name, function(session) {
- if (!session)
- return;
- doclist.addToHistory(session.name);
- session = env.split.setSession(session);
- whitespace.detectIndentation(session);
+ var doc = fileCache[name];
+ if (!doc)
+ return;
+
+ if (doc.session)
+ return setSession(doc.session)
+
+ //@todo do something while waiting
+ // env.editor.setSession(emptySession || (emptySession = new EditSession("")))
+ var path = doc.path;
+ var parts = path.split("/");
+ if (parts[0] == "docs")
+ path = "demo/kitchen-sink/" + path;
+ else if (parts[0] == "ace")
+ path = "lib/" + path;
+
+ net.get(path, function(x) {
+ initDoc(x, path, doc);
+ setSession(doc.session)
+ })
+
+ function setSession(session) {
+ var session = env.split.setSession(session);
updateUIEditorOptions();
env.editor.focus();
- });
+ }
});
-
function updateUIEditorOptions() {
var editor = env.editor;
var session = editor.session;
@@ -371,28 +468,40 @@ function updateUIEditorOptions() {
saveOption(behavioursEl, editor.getBehavioursEnabled());
}
-themelist.themes.forEach(function(x){ x.value = x.theme });
-fillDropdown(themeEl, {
- Bright: themelist.themes.filter(function(x){return !x.isDark}),
- Dark: themelist.themes.filter(function(x){return x.isDark}),
-});
+function saveOption(el, val) {
+ if (!el.onchange && !el.onclick)
+ return;
+
+ if ("checked" in el) {
+ if (val !== undefined)
+ el.checked = val;
+
+ localStorage && localStorage.setItem(el.id, el.checked ? 1 : 0);
+ }
+ else {
+ if (val !== undefined)
+ el.value = val;
+
+ localStorage && localStorage.setItem(el.id, el.value);
+ }
+}
event.addListener(themeEl, "mouseover", function(e){
- themeEl.desiredValue = e.target.value;
- if (!themeEl.$timer)
- themeEl.$timer = setTimeout(themeEl.updateTheme);
-});
+ this.desiredValue = e.target.value;
+ if (!this.$timer)
+ this.$timer = setTimeout(this.updateTheme);
+})
event.addListener(themeEl, "mouseout", function(e){
- themeEl.desiredValue = null;
- if (!themeEl.$timer)
- themeEl.$timer = setTimeout(themeEl.updateTheme, 20);
-});
+ this.desiredValue = null;
+ if (!this.$timer)
+ this.$timer = setTimeout(this.updateTheme, 20);
+})
themeEl.updateTheme = function(){
- env.split.setTheme((themeEl.desiredValue || themeEl.selectedValue));
+ env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue);
themeEl.$timer = null;
-};
+}
bindDropdown("theme", function(value) {
if (!value)
@@ -410,16 +519,38 @@ bindDropdown("fontsize", function(value) {
});
bindDropdown("folding", function(value) {
- env.editor.session.setFoldStyle(value);
+ env.editor.getSession().setFoldStyle(value);
env.editor.setShowFoldWidgets(value !== "manual");
});
bindDropdown("soft_wrap", function(value) {
- env.editor.setOption("wrap", value);
+ var session = env.editor.getSession();
+ var renderer = env.editor.renderer;
+ switch (value) {
+ case "off":
+ session.setUseWrapMode(false);
+ renderer.setPrintMarginColumn(80);
+ break;
+ case "40":
+ session.setUseWrapMode(true);
+ session.setWrapLimitRange(40, 40);
+ renderer.setPrintMarginColumn(40);
+ break;
+ case "80":
+ session.setUseWrapMode(true);
+ session.setWrapLimitRange(80, 80);
+ renderer.setPrintMarginColumn(80);
+ break;
+ case "free":
+ session.setUseWrapMode(true);
+ session.setWrapLimitRange(null, null);
+ renderer.setPrintMarginColumn(80);
+ break;
+ }
});
bindCheckbox("select_style", function(checked) {
- env.editor.setOption("selectionStyle", checked ? "line" : "text");
+ env.editor.setSelectionStyle(checked ? "line" : "text");
});
bindCheckbox("highlight_active", function(checked) {
@@ -447,11 +578,7 @@ bindCheckbox("highlight_selected_word", function(checked) {
});
bindCheckbox("show_hscroll", function(checked) {
- env.editor.setOption("hScrollBarAlwaysVisible", checked);
-});
-
-bindCheckbox("show_vscroll", function(checked) {
- env.editor.setOption("vScrollBarAlwaysVisible", checked);
+ env.editor.renderer.setHScrollBarAlwaysVisible(checked);
});
bindCheckbox("animate_scroll", function(checked) {
@@ -459,7 +586,7 @@ bindCheckbox("animate_scroll", function(checked) {
});
bindCheckbox("soft_tab", function(checked) {
- env.editor.session.setUseSoftTabs(checked);
+ env.editor.getSession().setUseSoftTabs(checked);
});
bindCheckbox("enable_behaviours", function(checked) {
@@ -469,117 +596,186 @@ bindCheckbox("enable_behaviours", function(checked) {
bindCheckbox("fade_fold_widgets", function(checked) {
env.editor.setFadeFoldWidgets(checked);
});
-bindCheckbox("read_only", function(checked) {
- env.editor.setReadOnly(checked);
-});
-bindCheckbox("scrollPastEnd", function(checked) {
- env.editor.setOption("scrollPastEnd", checked);
-});
+var secondSession = null;
bindDropdown("split", function(value) {
var sp = env.split;
if (value == "none") {
+ if (sp.getSplits() == 2) {
+ secondSession = sp.getEditor(1).session;
+ }
sp.setSplits(1);
} else {
var newEditor = (sp.getSplits() == 1);
- sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
+ if (value == "below") {
+ sp.setOrientation(sp.BELOW);
+ } else {
+ sp.setOrientation(sp.BESIDE);
+ }
sp.setSplits(2);
if (newEditor) {
- var session = sp.getEditor(0).session;
+ var session = secondSession || sp.getEditor(0).session;
var newSession = sp.setSession(session, 1);
newSession.name = session.name;
}
}
});
+function bindCheckbox(id, callback) {
+ var el = document.getElementById(id);
+ if (localStorage && localStorage.getItem(id))
+ el.checked = localStorage.getItem(id) == "1";
-bindCheckbox("elastic_tabstops", function(checked) {
- env.editor.setOption("useElasticTabstops", checked);
-});
-
-var iSearchCheckbox = bindCheckbox("isearch", function(checked) {
- env.editor.setOption("useIncrementalSearch", checked);
-});
-
-env.editor.addEventListener('incrementalSearchSettingChanged', function(event) {
- iSearchCheckbox.checked = event.isEnabled;
-});
-
-
-function synchroniseScrolling() {
- var s1 = env.split.$editors[0].session;
- var s2 = env.split.$editors[1].session;
- s1.on('changeScrollTop', function(pos) {s2.setScrollTop(pos)});
- s2.on('changeScrollTop', function(pos) {s1.setScrollTop(pos)});
- s1.on('changeScrollLeft', function(pos) {s2.setScrollLeft(pos)});
- s2.on('changeScrollLeft', function(pos) {s1.setScrollLeft(pos)});
+ var onCheck = function() {
+ callback(!!el.checked);
+ saveOption(el);
+ };
+ el.onclick = onCheck;
+ onCheck();
}
-bindCheckbox("highlight_token", function(checked) {
- var editor = env.editor;
- if (editor.tokenTooltip && !checked) {
- editor.tokenTooltip.destroy();
- delete editor.tokenTooltip;
- } else if (checked) {
- editor.tokenTooltip = new TokenTooltip(editor);
+function bindDropdown(id, callback) {
+ var el = document.getElementById(id);
+ if (localStorage && localStorage.getItem(id))
+ el.value = localStorage.getItem(id);
+
+ var onChange = function() {
+ callback(el.value);
+ saveOption(el);
+ };
+
+ el.onchange = onChange;
+ onChange();
+}
+
+function fillDropdown(list, el) {
+ list.forEach(function(item) {
+ var option = document.createElement("option");
+ option.setAttribute("value", item.name);
+ option.innerHTML = item.desc;
+ el.appendChild(option);
+ });
+}
+
+
+/************** dragover ***************************/
+event.addListener(container, "dragover", function(e) {
+ return event.preventDefault(e);
+});
+
+event.addListener(container, "drop", function(e) {
+ var file;
+ try {
+ file = e.dataTransfer.files[0];
+ if (window.FileReader) {
+ var reader = new FileReader();
+ reader.onload = function() {
+ var mode = getModeFromPath(file.name);
+
+ env.editor.session.doc.setValue(reader.result);
+ modeEl.value = mode.name;
+ env.editor.session.setMode(mode.mode);
+ env.editor.session.modeName = mode.name;
+ };
+ reader.readAsText(file);
+ }
+ return event.preventDefault(e);
+ } catch(err) {
+ return event.stopEvent(e);
}
});
-var StatusBar = require("ace/ext/statusbar").StatusBar;
-new StatusBar(env.editor, cmdLine.container);
+// add multiple cursor support to editor
+require("ace/multi_select").MultiSelect(env.editor);
-var Emmet = require("ace/ext/emmet");
-net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
- Emmet.setCore(window.emmet);
- env.editor.setOption("enableEmmet", true);
-});
+function singleLineEditor(el) {
+ var renderer = new Renderer(el);
+ renderer.scrollBar.element.style.display = "none";
+ renderer.scrollBar.width = 0;
+ renderer.content.style.height = "auto";
-// require("ace/placeholder").PlaceHolder;
+ renderer.screenToTextCoordinates = function(x, y) {
+ var pos = this.pixelToScreenCoordinates(x, y);
+ return this.session.screenToDocumentPosition(
+ Math.min(this.session.getScreenLength() - 1, Math.max(pos.row, 0)),
+ Math.max(pos.column, 0)
+ );
+ };
+ // todo size change event
+ renderer.$computeLayerConfig = function() {
+ var longestLine = this.$getLongestLine();
+ var firstRow = 0;
+ var lastRow = this.session.getLength();
+ var height = this.session.getScreenLength() * this.lineHeight;
-var snippetManager = require("ace/snippets").snippetManager;
+ this.scrollTop = 0;
+ var config = this.layerConfig;
+ config.width = longestLine;
+ config.padding = this.$padding;
+ config.firstRow = 0;
+ config.firstRowScreen = 0;
+ config.lastRow = lastRow;
+ config.lineHeight = this.lineHeight;
+ config.characterWidth = this.characterWidth;
+ config.minHeight = height;
+ config.maxHeight = height;
+ config.offset = 0;
+ config.height = height;
-env.editSnippets = function() {
- var sp = env.split;
- if (sp.getSplits() == 2) {
- sp.setSplits(1);
- return;
- }
- sp.setSplits(1);
- sp.setSplits(2);
- sp.setOrientation(sp.BESIDE);
- var editor = sp.$editors[1];
- var id = sp.$editors[0].session.$mode.$id || "";
- var m = snippetManager.files[id];
- if (!doclist["snippets/" + id]) {
- var text = m.snippetText;
- var s = doclist.initDoc(text, "", {});
- s.setMode("ace/mode/snippets");
- doclist["snippets/" + id] = s;
- }
- editor.on("blur", function() {
- m.snippetText = editor.getValue();
- snippetManager.unregister(m.snippets);
- m.snippets = snippetManager.parseSnippetFile(m.snippetText, m.scope);
- snippetManager.register(m.snippets);
- });
- sp.$editors[0].once("changeMode", function() {
- sp.setSplits(1);
- });
- editor.setSession(doclist["snippets/" + id], 1);
- editor.focus();
+ this.$gutterLayer.element.style.marginTop = 0 + "px";
+ this.content.style.marginTop = 0 + "px";
+ this.content.style.width = longestLine + 2 * this.$padding + "px";
+ this.content.style.height = height + "px";
+ this.scroller.style.height = height + "px";
+ this.container.style.height = height + "px";
+ };
+ renderer.isScrollableBy=function(){return false};
+
+ var editor = new Editor(renderer);
+ new MultiSelect(editor);
+ editor.session.setUndoManager(new UndoManager());
+
+ editor.setHighlightActiveLine(false);
+ editor.setShowPrintMargin(false);
+ editor.renderer.setShowGutter(false);
+ editor.renderer.setHighlightGutterLine(false);
+ return editor;
};
-require("ace/ext/language_tools");
-env.editor.setOptions({
- enableBasicAutocompletion: true,
- enableLiveAutocompletion: false,
- enableSnippets: true
+
+/** simple statusbar **/
+var editor = env.editor;
+var statusBarEl = dom.createElement("div");
+statusBarEl.style.cssText = "color:gray;position:absolute;right:0;border-left:1px solid";
+cmdLine.container.appendChild(statusBarEl);
+var statusUpdate = lang.deferredCall(function() {
+ var status = [];
+ function add(s, sep) {s && status.push(s, sep || "|")}
+ if (editor.$vimModeHandler)
+ add(editor.$vimModeHandler.getStatusText());
+ else if (editor.commands.recording)
+ add("REC");
+
+ var c = editor.selection.lead;
+ add(c.row + ":" + c.column, " ");
+ if (!editor.selection.isEmpty()) {
+ var r = editor.getSelectionRange()
+ add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")");
+ }
+ status.pop();
+ statusBarEl.textContent = status.join("");
+});
+
+env.editor.on("changeStatus", function() {
+ statusUpdate.schedule(50);
+});
+env.editor.on("changeSelection", function() {
+ statusUpdate.schedule(50);
});
-var beautify = require("ace/ext/beautify");
-env.editor.commands.addCommands(beautify.commands);
});
+
diff --git a/demo/kitchen-sink/dev_util.js b/demo/kitchen-sink/dev_util.js
deleted file mode 100644
index f466285d..00000000
--- a/demo/kitchen-sink/dev_util.js
+++ /dev/null
@@ -1,217 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
-define(function(require, exports, module) {
-var dom = require("ace/lib/dom");
-var Range = require("ace/range").Range;
-function warn() {
- var s = (new Error()).stack || "";
- s = s.split("\n");
- if (s[1] == "Error") s.shift(); // remove error description on chrome
- s.shift(); // remove warn
- s.shift(); // remove the getter
- s = s.join("\n");
- // allow easy access to ace in console, but not in ace code
- if (!/at Object.InjectedScript.|@debugger eval|snippets:\/{3}|\(:\d+:\d+\)/.test(s)) {
- console.error("trying to access to global variable");
- }
-}
-function def(o, key, get) {
- try {
- Object.defineProperty(o, key, {
- configurable: true,
- get: get,
- set: function(val) {
- delete o[key];
- o[key] = val;
- }
- });
- } catch(e) {
- console.error(e);
- }
-}
-def(window, "ace", function(){ warn(); return window.env.editor });
-def(window, "editor", function(){ warn(); return window.env.editor });
-def(window, "session", function(){ warn(); return window.env.editor.session });
-def(window, "split", function(){ warn(); return window.env.split });
-
-
-def(window, "devUtil", function(){ warn(); return exports });
-exports.showTextArea = function(argument) {
- dom.importCssString("\
- .ace_text-input {\
- position: absolute;\
- z-index: 10!important;\
- width: 6em!important;\
- height: 1em;\
- opacity: 1!important;\
- background: rgba(0, 92, 255, 0.11);\
- border: none;\
- font: inherit;\
- padding: 0 1px;\
- margin: 0 -1px;\
- text-indent: 0em;\
- }\
- ");
-};
-
-exports.addGlobals = function() {
- window.oop = require("ace/lib/oop");
- window.dom = require("ace/lib/dom");
- window.Range = require("ace/range").Range;
- window.Editor = require("ace/editor").Editor;
- window.assert = require("ace/test/asyncjs/assert");
- window.asyncjs = require("ace/test/asyncjs/async");
- window.UndoManager = require("ace/undomanager").UndoManager;
- window.EditSession = require("ace/edit_session").EditSession;
- window.MockRenderer = require("ace/test/mockrenderer").MockRenderer;
- window.EventEmitter = require("ace/lib/event_emitter").EventEmitter;
-
- window.getSelection = getSelection;
- window.setSelection = setSelection;
- window.testSelection = testSelection;
-};
-
-function getSelection(editor) {
- var data = editor.multiSelect.toJSON();
- if (!data.length) data = [data];
- data = data.map(function(x) {
- var a, c;
- if (x.isBackwards) {
- a = x.end;
- c = x.start;
- } else {
- c = x.end;
- a = x.start;
- }
- return Range.comparePoints(a, c)
- ? [a.row, a.column, c.row, c.column]
- : [a.row, a.column];
- });
- return data.length > 1 ? data : data[0];
-}
-function setSelection(editor, data) {
- if (typeof data[0] == "number")
- data = [data];
- editor.selection.fromJSON(data.map(function(x) {
- var start = {row: x[0], column: x[1]};
- var end = x.length == 2 ? start : {row: x[2], column: x[3]};
- var isBackwards = Range.comparePoints(start, end) > 0;
- return isBackwards ? {
- start: end,
- end: start,
- isBackwards: true
- } : {
- start: start,
- end: end,
- isBackwards: true
- };
- }));
-}
-function testSelection(editor, data) {
- assert.equal(getSelection(editor) + "", data + "");
-}
-
-exports.recordTestCase = function() {
- exports.addGlobals();
- var editor = window.editor;
- var testcase = window.testcase = [];
- var assert;
-
- testcase.push({
- type: "setValue",
- data: editor.getValue()
- }, {
- type: "setSelection",
- data: getSelection(editor)
- });
- editor.commands.on("afterExec", function(e) {
- testcase.push({
- type: "exec",
- data: e
- });
- testcase.push({
- type: "value",
- data: editor.getValue()
- });
- testcase.push({
- type: "selection",
- data: getSelection(editor)
- });
- });
- editor.on("mouseup", function() {
- testcase.push({
- type: "setSelection",
- data: getSelection(editor)
- });
- });
-
- testcase.toString = function() {
- var lastValue = "";
- // var lastSelection = ""
- var str = this.map(function(x) {
- var data = x.data;
- switch (x.type) {
- case "exec":
- return 'editor.execCommand("'
- + data.command.name
- + (data.args ? '", ' + JSON.stringify(data.args) : '"')
- + ')';
- case "setSelection":
- return 'setSelection(editor, ' + JSON.stringify(data) + ')';
- case "setValue":
- if (lastValue != data) {
- lastValue = data;
- return 'editor.setValue(' + JSON.stringify(data) + ', -1)';
- }
- return;
- case "selection":
- return 'testSelection(editor, ' + JSON.stringify(data) + ')';
- case "value":
- if (lastValue != data) {
- lastValue = data;
- return 'assert.equal('
- + 'editor.getValue(),'
- + JSON.stringify(data)
- + ')';
- }
- return;
- }
- }).filter(Boolean).join("\n");
-
- return getSelection + "\n"
- + testSelection + "\n"
- + setSelection + "\n"
- + "\n" + str + "\n";
- };
-};
-
-
-});
diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js
deleted file mode 100644
index a4848d50..00000000
--- a/demo/kitchen-sink/doclist.js
+++ /dev/null
@@ -1,218 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Distributed under the BSD license:
- *
- * Copyright (c) 2010, Ajax.org B.V.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Ajax.org B.V. nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ***** END LICENSE BLOCK ***** */
-
- define(function(require, exports, module) {
-"use strict";
-
-var EditSession = require("ace/edit_session").EditSession;
-var UndoManager = require("ace/undomanager").UndoManager;
-var net = require("ace/lib/net");
-
-var modelist = require("ace/ext/modelist");
-/*********** demo documents ***************************/
-var fileCache = {};
-
-function initDoc(file, path, doc) {
- if (doc.prepare)
- file = doc.prepare(file);
-
- var session = new EditSession(file);
- session.setUndoManager(new UndoManager());
- doc.session = session;
- doc.path = path;
- session.name = doc.name;
- if (doc.wrapped) {
- session.setUseWrapMode(true);
- session.setWrapLimitRange(80, 80);
- }
- var mode = modelist.getModeForPath(path);
- session.modeName = mode.name;
- session.setMode(mode.mode);
- return session;
-}
-
-
-function makeHuge(txt) {
- for (var i = 0; i < 5; i++)
- txt += txt;
- return txt;
-}
-
-var docs = {
- "docs/javascript.js": {order: 1, name: "JavaScript"},
-
- "docs/latex.tex": {name: "LaTeX", wrapped: true},
- "docs/markdown.md": {name: "Markdown", wrapped: true},
- "docs/mushcode.mc": {name: "MUSHCode", wrapped: true},
- "docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
- "docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
- "docs/sql.sql": {name: "SQL", wrapped: true},
-
- "docs/textile.textile": {name: "Textile", wrapped: true},
-
- "docs/c9search.c9search_results": "C9 Search Results",
- "docs/mel.mel": "MEL",
- "docs/Nix.nix": "Nix"
-};
-
-var ownSource = {
- /* filled from require*/
-};
-
-var hugeDocs = require.toUrl ? {
- "build/src/ace.js": "",
- "build/src-min/ace.js": ""
-} : {
- "src/ace.js": "",
- "src-min/ace.js": ""
-};
-
-modelist.modes.forEach(function(m) {
- var ext = m.extensions.split("|")[0];
- if (ext[0] === "^") {
- path = ext.substr(1);
- } else {
- var path = m.name + "." + ext;
- }
- path = "docs/" + path;
- if (!docs[path]) {
- docs[path] = {name: m.caption};
- } else if (typeof docs[path] == "object" && !docs[path].name) {
- docs[path].name = m.caption;
- }
-});
-
-
-
-if (window.require && window.require.s) try {
- for (var path in window.require.s.contexts._.defined) {
- if (path.indexOf("!") != -1)
- path = path.split("!").pop();
- else
- path = path + ".js";
- ownSource[path] = "";
- }
-} catch(e) {}
-
-function sort(list) {
- return list.sort(function(a, b) {
- var cmp = (b.order || 0) - (a.order || 0);
- return cmp || a.name && a.name.localeCompare(b.name);
- });
-}
-
-function prepareDocList(docs) {
- var list = [];
- for (var path in docs) {
- var doc = docs[path];
- if (typeof doc != "object")
- doc = {name: doc || path};
-
- doc.path = path;
- doc.desc = doc.name.replace(/^(ace|docs|demo|build)\//, "");
- if (doc.desc.length > 18)
- doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9);
-
- fileCache[doc.name] = doc;
- list.push(doc);
- }
-
- return list;
-}
-
-function loadDoc(name, callback) {
- var doc = fileCache[name];
- if (!doc)
- return callback(null);
-
- if (doc.session)
- return callback(doc.session);
-
- // TODO: show load screen while waiting
- var path = doc.path;
- var parts = path.split("/");
- if (parts[0] == "docs")
- path = "demo/kitchen-sink/" + path;
- else if (parts[0] == "ace")
- path = "lib/" + path;
-
- net.get(path, function(x) {
- initDoc(x, path, doc);
- callback(doc.session);
- });
-}
-
-function saveDoc(name, callback) {
- var doc = fileCache[name] || name;
- if (!doc || !doc.session)
- return callback("Unknown document: " + name);
-
- var path = doc.path;
- var parts = path.split("/");
- if (parts[0] == "docs")
- path = "demo/kitchen-sink/" + path;
- else if (parts[0] == "ace")
- path = "lib/" + path;
-
- upload(path, doc.session.getValue(), callback);
-}
-
-function upload(url, data, callback) {
- url = net.qualifyURL(url);
- if (!/https?:/.test(url))
- return callback(new Error("Unsupported url scheme"));
- var xhr = new XMLHttpRequest();
- xhr.open("PUT", url, true);
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- callback(!/^2../.test(xhr.status));
- }
- };
- xhr.send(data);
-};
-
-
-module.exports = {
- fileCache: fileCache,
- docs: sort(prepareDocList(docs)),
- ownSource: prepareDocList(ownSource),
- hugeDocs: prepareDocList(hugeDocs),
- initDoc: initDoc,
- loadDoc: loadDoc,
- saveDoc: saveDoc,
-};
-module.exports.all = {
- "Mode Examples": module.exports.docs,
- "Huge documents": module.exports.hugeDocs,
- "own source": module.exports.ownSource
-};
-
-});
-
diff --git a/demo/kitchen-sink/docs/.gitignore b/demo/kitchen-sink/docs/.gitignore
deleted file mode 100644
index 56ec8fd9..00000000
--- a/demo/kitchen-sink/docs/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# A sample .gitignore file.
-
-.buildlog
-.DS_Store
-.svn
-
-# Negated patterns:
-!foo.bar
-
-# Also ignore user settings...
-/.settings
diff --git a/demo/kitchen-sink/docs/Dockerfile b/demo/kitchen-sink/docs/Dockerfile
deleted file mode 100644
index 70270cbf..00000000
--- a/demo/kitchen-sink/docs/Dockerfile
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# example Dockerfile for http://docs.docker.io/en/latest/examples/postgresql_service/
-#
-
-FROM ubuntu
-MAINTAINER SvenDowideit@docker.com
-
-# Add the PostgreSQL PGP key to verify their Debian packages.
-# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
-RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
-
-# Add PostgreSQL's repository. It contains the most recent stable release
-# of PostgreSQL, ``9.3``.
-RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
-
-# Update the Ubuntu and PostgreSQL repository indexes
-RUN apt-get update
-
-# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
-# There are some warnings (in red) that show up during the build. You can hide
-# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
-RUN apt-get -y -q install python-software-properties software-properties-common
-RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
-
-# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
-# after each ``apt-get``
-
-# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
-USER postgres
-
-# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
-# then create a database `docker` owned by the ``docker`` role.
-# Note: here we use ``&&\`` to run commands one after the other - the ``\``
-# allows the RUN command to span multiple lines.
-RUN /etc/init.d/postgresql start &&\
- psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\
- createdb -O docker docker
-
-# Adjust PostgreSQL configuration so that remote connections to the
-# database are possible.
-RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
-
-# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
-RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
-
-# Expose the PostgreSQL port
-EXPOSE 5432
-
-# Add VOLUMEs to allow backup of config, logs and databases
-VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
-
-# Set the default command to run when starting the container
-CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/Jack.jack b/demo/kitchen-sink/docs/Jack.jack
deleted file mode 100644
index 15acf743..00000000
--- a/demo/kitchen-sink/docs/Jack.jack
+++ /dev/null
@@ -1,247 +0,0 @@
-vars it, p
-
-p = {label, value|
- print("\n" + label)
- print(inspect(value))
-}
--- Create an array from 0 to 15
-p("range", i-collect(range(5)))
-
--- Create an array from 0 to 15 and break up in chunks of 4
-p("chunked range", i-collect(i-chunk(4, range(16))))
-
--- Check if all or none items in stream pass test.
-p("all < 60 in range(60)", i-all?({i|i<60}, range(60)))
-p("any < 60 in range(60)", i-any?({i|i>60}, range(60)))
-p("all < 60 in range(70)", i-all?({i|i<60}, range(70)))
-p("any < 60 in range(70)", i-any?({i|i>60}, range(70)))
-
--- Zip three different collections together
-p("zipped", i-collect(i-zip(
- range(10),
- [1,2,3,4,5],
- i-map({i|i*i}, range(10))
-)))
-
-vars names, person, i, doubles, lengths, cubeRange
-names = ["Thorin", "Dwalin", "Balin", "Bifur", "Bofur", "Bombur", "Oin",
- "Gloin", "Ori", "Nori", "Dori", "Fili", "Kili", "Bilbo", "Gandalf"]
-
-for name in names {
- if name != "Bilbo" && name != "Gandalf" {
- print(name)
- }
-}
-
-person = {name: "Tim", age: 30}
-for key, value in person {
- print(key + " = " + value)
-}
-
-i = 0
-while i < 10 {
- i = i + 1
- print(i)
-}
-
-print("range")
-for i in range(10) {
- print(i + 1)
-}
-for i in range(10) {
- print(10 - i)
-}
-
--- Dynamic object that gives the first 10 doubles
-doubles = {
- @len: {| 10 }
- @get: {key|
- if key is Integer { key * key }
- }
-}
-print("#doubles", #doubles)
-
-print("Doubles")
-for k, v in doubles {
- print([k, v])
-}
-
--- Dynamic object that has names list as keys and string lenth as values
-lengths = {
- @keys: {| names }
- @get: {key|
- if key is String { #key }
- }
-}
-
-print ("Lengths")
-for k, v in lengths {
- print([k, v])
-}
-
-
-cubeRange = {n|
- vars i, v
- i = 0
- {
- @call: {|
- v = i
- i = i + 1
- if v < n { v * v * v }
- }
- }
-}
-
-print("Cubes")
-for k, v in cubeRange(5) {
- print([k, v])
-}
-print("String")
-for k, v in "Hello World" {
- print([k, v])
-}
-
-
-print([i for i in range(10)])
-print([i for i in range(20) if i % 3])
-
-
-
--- Example showing how to do parallel work using split..and
-base = {bootstrap, target-dir|
- split {
- copy("res", target-dir)
- } and {
- if newer("src/*.less", target-dir + "/style.css") {
- lessc("src/" + bootstrap + ".less", target-dir + "/style.css")
- }
- } and {
- build("src/" + bootstrap + ".js", target-dir + "/app.js")
- }
-}
-
-
-vars Dragon, pet
-
-Dragon = {name|
- vars asleep, stuff-in-belly, stuff-in-intestine,
- feed, walk, put-to-bed, toss, rock,
- hungry?, poopy?, passage-of-time
-
- asleep = false
- stuff-in-belly = 10 -- He's full.
- stuff-in-intestine = 0 -- He doesn't need to go.
-
- print(name + ' is born.')
-
- feed = {|
- print('You feed ' + name + '.')
- stuff-in-belly = 10
- passage-of-time()
- }
-
- walk = {|
- print('You walk ' + name + ".")
- stuff-in-intestine = 0
- passage-of-time
- }
-
- put-to-bed = {|
- print('You put ' + name + ' to bed.')
- asleep = true
- for i in range(3) {
- if asleep {
- passage-of-time()
- }
- if asleep {
- print(name + ' snores, filling the room with smoke.')
- }
- }
- if asleep {
- asleep = false
- print(name + ' wakes up slowly.')
- }
- }
-
- toss = {|
- print('You toss ' + name + ' up into the air.')
- print('He giggles, which singes your eyebrows.')
- passage-of-time()
- }
-
- rock = {|
- print('You rock ' + name + ' gently.')
- asleep = true
- print('He briefly dozes off...')
- passage-of-time()
- if asleep {
- asleep = false
- print('...but wakes when you stop.')
- }
- }
-
- hungry? = {|
- stuff-in-belly <= 2
- }
-
- poopy? = {|
- stuff-in-intestine >= 8
- }
-
- passage-of-time = {|
- if stuff-in-belly > 0 {
- -- Move food from belly to intestine
- stuff-in-belly = stuff-in-belly - 1
- stuff-in-intestine = stuff-in-intestine + 1
- } else { -- Our dragon is starving!
- if asleep {
- asleep = false
- print('He wakes up suddenly!')
- }
- print(name + ' is starving! In desperation, he ate YOU!')
- abort "died"
- }
-
- if stuff-in-intestine >= 10 {
- stuff-in-intestine = 0
- print('Whoops! ' + name + ' had an accident...')
- }
-
- if hungry?() {
- if asleep {
- asleep = false
- print('He wakes up suddenly!')
- }
- print(name + "'s stomach grumbles...")
- }
-
- if poopy?() {
- if asleep {
- asleep = false
- print('He wakes up suddenly!')
- }
- print(name + ' does the potty dance...')
- }
- }
-
- -- Export the public interface to this closure object.
- {
- feed: feed
- walk: walk
- put-to-bed: put-to-bed
- toss: toss
- rock: rock
- }
-
-}
-
-pet = Dragon('Norbert')
-pet.feed()
-pet.toss()
-pet.walk()
-pet.put-to-bed()
-pet.rock()
-pet.put-to-bed()
-pet.put-to-bed()
-pet.put-to-bed()
-pet.put-to-bed()
diff --git a/demo/kitchen-sink/docs/Makefile b/demo/kitchen-sink/docs/Makefile
deleted file mode 100644
index 9b0b31ac..00000000
--- a/demo/kitchen-sink/docs/Makefile
+++ /dev/null
@@ -1,122 +0,0 @@
-.PHONY: apf ext worker mode theme package test
-
-default: apf worker
-
-update: worker
-
-# packages apf
-
-# This is the first line of a comment \
-and this is still part of the comment \
-as is this, since I keep ending each line \
-with a backslash character
-
-apf:
- cd node_modules/packager; node package.js projects/apf_cloud9.apr
- cd node_modules/packager; cat build/apf_release.js | sed 's/\(\/\*FILEHEAD(\).*//g' > ../../plugins-client/lib.apf/www/apf-packaged/apf_release.js
-
-# package debug version of apf
-apfdebug:
- cd node_modules/packager/projects; cat apf_cloud9.apr | sed 's///g' > apf_cloud9_debug2.apr
- cd node_modules/packager/projects; cat apf_cloud9_debug2.apr | sed 's/apf_release/apf_debug/g' > apf_cloud9_debug.apr; rm apf_cloud9_debug2.apr
- cd node_modules/packager; node package.js projects/apf_cloud9_debug.apr
- cd node_modules/packager; cat build/apf_debug.js | sed 's/\(\/\*FILEHEAD(\).*\/apf\/\(.*\)/\1\2/g' > ../../plugins-client/lib.apf/www/apf-packaged/apf_debug.js
-
-# package_apf--temporary fix for non-workering infra
-pack_apf:
- mkdir -p build/src
- mv plugins-client/lib.apf/www/apf-packaged/apf_release.js build/src/apf_release.js
- node build/r.js -o name=./build/src/apf_release.js out=./plugins-client/lib.apf/www/apf-packaged/apf_release.js baseUrl=.
-
-# makes ace; at the moment, requires dryice@0.4.2
-ace:
- cd node_modules/ace; make clean pre_build; ./Makefile.dryice.js minimal
-
-
-# packages core
-core: ace
- mkdir -p build/src
- node build/r.js -o build/core.build.js
-
-# generates packed template
-helper:
- node build/packed_helper.js
-
-helper_clean:
- mkdir -p build/src
- node build/packed_helper.js 1
-
-# packages ext
-ext:
- node build/r.js -o build/app.build.js
-
-# calls dryice on worker & packages it
-worker: plugins-client/lib.ace/www/worker/worker-language.js
-
-plugins-client/lib.ace/www/worker/worker-language.js plugins-client/lib.ace/www/worker/worker-javascript.js : \
- $(wildcard node_modules/ace/*) $(wildcard node_modules/ace/*/*) $(wildcard node_modules/ace/*/*/mode/*) \
- $(wildcard plugins-client/ext.language/*) \
- $(wildcard plugins-client/ext.language/*/*) \
- $(wildcard plugins-client/ext.linereport/*) \
- $(wildcard plugins-client/ext.codecomplete/*) \
- $(wildcard plugins-client/ext.codecomplete/*/*) \
- $(wildcard plugins-client/ext.jslanguage/*) \
- $(wildcard plugins-client/ext.jslanguage/*/*) \
- $(wildcard plugins-client/ext.csslanguage/*) \
- $(wildcard plugins-client/ext.csslanguage/*/*) \
- $(wildcard plugins-client/ext.htmllanguage/*) \
- $(wildcard plugins-client/ext.htmllanguage/*/*) \
- $(wildcard plugins-client/ext.jsinfer/*) \
- $(wildcard plugins-client/ext.jsinfer/*/*) \
- $(wildcard node_modules/treehugger/lib/*) \
- $(wildcard node_modules/treehugger/lib/*/*) \
- $(wildcard node_modules/ace/lib/*) \
- $(wildcard node_modules/ace/*/*) \
- Makefile.dryice.js
- mkdir -p plugins-client/lib.ace/www/worker
- rm -rf /tmp/c9_worker_build
- mkdir -p /tmp/c9_worker_build/ext
- ln -s `pwd`/plugins-client/ext.language /tmp/c9_worker_build/ext/language
- ln -s `pwd`/plugins-client/ext.codecomplete /tmp/c9_worker_build/ext/codecomplete
- ln -s `pwd`/plugins-client/ext.jslanguage /tmp/c9_worker_build/ext/jslanguage
- ln -s `pwd`/plugins-client/ext.csslanguage /tmp/c9_worker_build/ext/csslanguage
- ln -s `pwd`/plugins-client/ext.htmllanguage /tmp/c9_worker_build/ext/htmllanguage
- ln -s `pwd`/plugins-client/ext.linereport /tmp/c9_worker_build/ext/linereport
- ln -s `pwd`/plugins-client/ext.linereport_php /tmp/c9_worker_build/ext/linereport_php
- node Makefile.dryice.js worker
- cp node_modules/ace/build/src/worker* plugins-client/lib.ace/www/worker
-
-define
-
-ifeq
-
-override
-
-# copies built ace modes
-mode:
- mkdir -p plugins-client/lib.ace/www/mode
- cp `find node_modules/ace/build/src | grep -E "mode-[a-zA-Z_0-9]+.js"` plugins-client/lib.ace/www/mode
-
-# copies built ace themes
-theme:
- mkdir -p plugins-client/lib.ace/www/theme
- cp `find node_modules/ace/build/src | grep -E "theme-[a-zA-Z_0-9]+.js"` plugins-client/lib.ace/www/theme
-
-gzip_safe:
- for i in `ls ./plugins-client/lib.packed/www/*.js`; do \
- gzip -9 -v -c -q -f $$i > $$i.gz ; \
- done
-
-gzip:
- for i in `ls ./plugins-client/lib.packed/www/*.js`; do \
- gzip -9 -v -q -f $$i ; \
- done
-
-c9core: apf ace core worker mode theme
-
-package_clean: helper_clean c9core ext
-
-package: helper c9core ext
-
-test check:
- test/run-tests.sh
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/Nix.nix b/demo/kitchen-sink/docs/Nix.nix
deleted file mode 100644
index 9476db3b..00000000
--- a/demo/kitchen-sink/docs/Nix.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{
- # Name of our deployment
- network.description = "HelloWorld";
- # Enable rolling back to previous versions of our infrastructure
- network.enableRollback = true;
-
- # It consists of a single server named 'helloserver'
- helloserver =
- # Every server gets passed a few arguments, including a reference
- # to nixpkgs (pkgs)
- { config, pkgs, ... }:
- let
- # We import our custom packages from ./default passing pkgs as argument
- packages = import ./default.nix { pkgs = pkgs; };
- # This is the nodejs version specified in default.nix
- nodejs = packages.nodejs;
- # And this is the application we'd like to deploy
- app = packages.app;
- in
- {
- # We'll be running our application on port 8080, because a regular
- # user cannot bind to port 80
- # Then, using some iptables magic we'll forward traffic designated to port 80 to 8080
- networking.firewall.enable = true;
- # We will open up port 22 (SSH) as well otherwise we're locking ourselves out
- networking.firewall.allowedTCPPorts = [ 80 8080 22 ];
- networking.firewall.allowPing = true;
-
- # Port forwarding using iptables
- networking.firewall.extraCommands = ''
- iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
- '';
-
- # To run our node.js program we're going to use a systemd service
- # We can configure the service to automatically start on boot and to restart
- # the process in case it crashes
- systemd.services.helloserver = {
- description = "Hello world application";
- # Start the service after the network is available
- after = [ "network.target" ];
- # We're going to run it on port 8080 in production
- environment = { PORT = "8080"; };
- serviceConfig = {
- # The actual command to run
- ExecStart = "${nodejs}/bin/node ${app}/server.js";
- # For security reasons we'll run this process as a special 'nodejs' user
- User = "nodejs";
- Restart = "always";
- };
- };
-
- # And lastly we ensure the user we run our application as is created
- users.extraUsers = {
- nodejs = { };
- };
- };
-}
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/scad.scad b/demo/kitchen-sink/docs/OpenSCAD.scad
similarity index 100%
rename from demo/kitchen-sink/docs/scad.scad
rename to demo/kitchen-sink/docs/OpenSCAD.scad
diff --git a/demo/kitchen-sink/docs/abap.abap b/demo/kitchen-sink/docs/abap.abap
deleted file mode 100644
index f66bfdfa..00000000
--- a/demo/kitchen-sink/docs/abap.abap
+++ /dev/null
@@ -1,36 +0,0 @@
-***************************************
-** Program: EXAMPLE **
-** Author: Joe Byte, 07-Jul-2007 **
-***************************************
-
-REPORT BOOKINGS.
-
-* Read flight bookings from the database
-SELECT * FROM FLIGHTINFO
- WHERE CLASS = 'Y' "Y = economy
- OR CLASS = 'C'. "C = business
-(...)
-
-REPORT TEST.
-WRITE 'Hello World'.
-
-USERPROMPT = 'Please double-click on a line in the output list ' &
- 'to see the complete details of the transaction.'.
-
-
-DATA LAST_EOM TYPE D. "last end-of-month date
-
-* Start from today's date
- LAST_EOM = SY-DATUM.
-* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to "01",
-* giving the first day of the current month
- LAST_EOM+6(2) = '01'.
-* Subtract one day
- LAST_EOM = LAST_EOM - 1.
-
- WRITE: 'Last day of previous month was', LAST_EOM.
-
-DATA : BEGIN OF I_VBRK OCCURS 0,
- VBELN LIKE VBRK-VBELN,
- ZUONR LIKE VBRK-ZUONR,
- END OF I_VBRK.
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/abc.abc b/demo/kitchen-sink/docs/abc.abc
deleted file mode 100644
index d8ac326e..00000000
--- a/demo/kitchen-sink/docs/abc.abc
+++ /dev/null
@@ -1,171 +0,0 @@
-%abc-2.1
-H:This file contains some example English tunes
-% note that the comments (like this one) are to highlight usages
-% and would not normally be included in such detail
-O:England % the origin of all tunes is England
-
-X:1 % tune no 1
-T:Dusty Miller, The % title
-T:Binny's Jig % an alternative title
-C:Trad. % traditional
-R:DH % double hornpipe
-M:3/4 % meter
-K:G % key
-B>cd BAG|FA Ac BA|B>cd BAG|DG GB AG:|
-Bdd gfg|aA Ac BA|Bdd gfa|gG GB AG:|
-BG G/2G/2G BG|FA Ac BA|BG G/2G/2G BG|DG GB AG:|
-W:Hey, the dusty miller, and his dusty coat;
-W:He will win a shilling, or he spend a groat.
-W:Dusty was the coat, dusty was the colour;
-W:Dusty was the kiss, that I got frae the miller.
-
-X:2
-T:Old Sir Simon the King
-C:Trad.
-S:Offord MSS % from Offord manuscript
-N:see also Playford % reference note
-M:9/8
-R:SJ % slip jig
-N:originally in C % transcription note
-K:G
-D|GFG GAG G2D|GFG GAG F2D|EFE EFE EFG|A2G F2E D2:|
-D|GAG GAB d2D|GAG GAB c2D|[1 EFE EFE EFG|[A2G] F2E D2:|\ % no line-break in score
-M:12/8 % change of meter
-[2 E2E EFE E2E EFG|\ % no line-break in score
-M:9/8 % change of meter
-A2G F2E D2|]
-
-X:3
-T:William and Nancy
-T:New Mown Hay
-T:Legacy, The
-C:Trad.
-O:England; Gloucs; Bledington % place of origin
-B:Sussex Tune Book % can be found in these books
-B:Mally's Cotswold Morris vol.1 2
-D:Morris On % can be heard on this record
-P:(AB)2(AC)2A % play the parts in this order
-M:6/8
-K:G
-[P:A] D|"G"G2G GBd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
-[P:B] d|"G"e2d B2d|"C"gfe "G"d2d| "G"e2d B2d|"C"gfe "D7"d2c|
- "G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
-% changes of meter, using inline fields
-[T:Slows][M:4/4][L:1/4][P:C]"G"d2|"C"e2 "G"d2|B2 d2|"Em"gf "A7"e2|"D7"d2 "G"d2|\
- "C"e2 "G"d2|[M:3/8][L:1/8] "G"B2 d |[M:6/8] "C"gfe "D7"d2c|
- "G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
-
-X:4
-T:South Downs Jig
-R:jig
-S:Robert Harbron
-M:6/8
-L:1/8
-K:G
-|: d | dcA G3 | EFG AFE | DEF GAB | cde d2d |
-dcA G3 | EFG AFE | DEF GAB | cAF G2 :|
-B | Bcd e2c | d2B c2A | Bcd e2c | [M:9/8]d2B c2B A3 |
-[M:6/8]DGF E3 | cBA FED | DEF GAB |1 cAF G2 :|2 cAF G3 |]
-
-X:5
-T:Atholl Brose
-% in this example, which reproduces Highland Bagpipe gracing,
-% the large number of grace notes mean that it is more convenient to be specific about
-% score line-breaks (using the $ symbol), rather than using code line breaks to indicate them
-I:linebreak $
-K:D
-{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
-{gcd}c<{e}A {gAGAG}A>e {ag}a>f {gef}e>d|
-{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
-{g}c/d/e {g}G>{d}B {gf}gG {dc}d>B:|$
-{g}ce {ag}a>e {gf}g>e|
-{g}ce {ag}a2 {GdG}a>d|
-{g}ce {ag}a>e {gf}g>f|
-{gef}e>d {gf}g>d {gBd}B<{e}G {dc}d>B|
-{g}ce {ag}a>e {gf}g>e|
-{g}ce {ag}a2 {GdG}ad|
-{g}c<{GdG}e {gf}ga {f}g>e {g}f>d|
-{g}e/f/g {Gdc}d>c {gBd}B<{e}G {dc}d2|]
-
-X:6
-T:Untitled Reel
-C:Trad.
-K:D
-eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|\
-ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
-K:G
-AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|
-
-X:7
-T:Kitchen Girl
-C:Trad.
-K:D
-[c4a4] [B4g4]|efed c2cd|e2f2 gaba|g2e2 e2fg|
-a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
-K:G
-ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
-ABAG EGAB|cBAc BAG2|A4 A4:|
-
-%abc-2.1
-%%pagewidth 21cm
-%%pageheight 29.7cm
-%%topspace 0.5cm
-%%topmargin 1cm
-%%botmargin 0cm
-%%leftmargin 1cm
-%%rightmargin 1cm
-%%titlespace 0cm
-%%titlefont Times-Bold 32
-%%subtitlefont Times-Bold 24
-%%composerfont Times 16
-%%vocalfont Times-Roman 14
-%%staffsep 60pt
-%%sysstaffsep 20pt
-%%musicspace 1cm
-%%vocalspace 5pt
-%%measurenb 0
-%%barsperstaff 5
-%%scale 0.7
-X: 1
-T: Canzonetta a tre voci
-C: Claudio Monteverdi (1567-1643)
-M: C
-L: 1/4
-Q: "Andante mosso" 1/4 = 110
-%%score [1 2 3]
-V: 1 clef=treble name="Soprano"sname="A"
-V: 2 clef=treble name="Alto" sname="T"
-V: 3 clef=bass middle=d name="Tenor" sname="B"
-%%MIDI program 1 75 % recorder
-%%MIDI program 2 75
-%%MIDI program 3 75
-K: Eb
-% 1 - 4
-[V: 1] |:z4 |z4 |f2ec |_ddcc |
-w: Son que-sti~i cre-spi cri-ni~e
-w: Que-sti son gli~oc-chi che mi-
-[V: 2] |:c2BG|AAGc|(F/G/A/B/)c=A|B2AA |
-w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e
-w: Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-
-[V: 3] |:z4 |f2ec|_ddcf |(B/c/_d/e/)ff|
-w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il
-w: Que-sti son~gli oc-chi che mi-ran - - - - do
-% 5 - 9
-[V: 1] cAB2 |cAAA |c3B|G2!fermata!Gz ::e4|
-w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
-w: ran-do fi-so, tut-to re-stai con-qui-so.
-[V: 2] AAG2 |AFFF |A3F|=E2!fermata!Ez::c4|
-w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
-w: ran-do fi-so tut-to re-stai con-qui-so.
-[V: 3] (ag/f/e2)|A_ddd|A3B|c2!fermata!cz ::A4|
-w: vi - - - so ond' io ti-man-go~uc-ci-so. Deh,
-w: fi - - - so tut-to re-stai con-qui-so.
-% 10 - 15
-[V: 1] f_dec |B2c2|zAGF |\
-w: dim-me-lo ben mi-o, che que-sto\
-=EFG2 |1F2z2:|2F8|] % more notes
-w: sol de-si-o_. % more lyrics
-[V: 2] ABGA |G2AA|GF=EF |(GF3/2=E//D//E)|1F2z2:|2F8|]
-w: dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_.
-[V: 3] _dBc>d|e2AF|=EFc_d|c4 |1F2z2:|2F8|]
-w: dim-me-lo ben mi-o, che que-sto sol de-si-o_.
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/actionscript.as b/demo/kitchen-sink/docs/actionscript.as
deleted file mode 100644
index ffe21fbf..00000000
--- a/demo/kitchen-sink/docs/actionscript.as
+++ /dev/null
@@ -1,51 +0,0 @@
-package code
-{
- /*****************************************
- * based on textmate actionscript bundle
- ****************************************/
-
- import fl.events.SliderEvent;
-
- public class Foo extends MovieClip
- {
- //*************************
- // Properties:
-
- public var activeSwatch:MovieClip;
-
- // Color offsets
- public var c1:Number = 0; // R
-
- //*************************
- // Constructor:
-
- public function Foo()
- {
- // Respond to mouse events
- swatch1_btn.addEventListener(MouseEvent.CLICK,swatchHandler,false,0,false);
- previewBox_btn.addEventListener(MouseEvent.MOUSE_DOWN,dragPressHandler);
-
- // Respond to drag events
- red_slider.addEventListener(SliderEvent.THUMB_DRAG,sliderHandler);
-
- // Draw a frame later
- addEventListener(Event.ENTER_FRAME,draw);
- }
-
- protected function clickHandler(event:MouseEvent):void
- {
- car.transform.colorTransform = new ColorTransform(0,0,0,1,c1,c2,c3);
- }
-
- protected function changeRGBHandler(event:Event):void
- {
- c1 = Number(c1_txt.text);
-
- if(!(c1>=0)){
- c1 = 0;
- }
-
- updateSliders();
- }
- }
-}
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/ada.ada b/demo/kitchen-sink/docs/ada.ada
deleted file mode 100644
index 90e027f0..00000000
--- a/demo/kitchen-sink/docs/ada.ada
+++ /dev/null
@@ -1,5 +0,0 @@
-with Ada.Text_IO; use Ada.Text_IO;
-procedure Hello is
-begin
- Put_Line("Hello, world!");
-end Hello;
\ No newline at end of file
diff --git a/demo/kitchen-sink/docs/asciidoc.asciidoc b/demo/kitchen-sink/docs/asciidoc.asciidoc
deleted file mode 100644
index 8cddab5d..00000000
--- a/demo/kitchen-sink/docs/asciidoc.asciidoc
+++ /dev/null
@@ -1,6040 +0,0 @@
-AsciiDoc User Guide
-===================
-Stuart Rackham
-:Author Initials: SJR
-:toc:
-:icons:
-:numbered:
-:website: http://www.methods.co.nz/asciidoc/
-
-AsciiDoc is a text document format for writing notes, documentation,
-articles, books, ebooks, slideshows, web pages, blogs and UNIX man
-pages. AsciiDoc files can be translated to many formats including
-HTML, PDF, EPUB, man page. AsciiDoc is highly configurable: both the
-AsciiDoc source file syntax and the backend output markups (which can
-be almost any type of SGML/XML markup) can be customized and extended
-by the user.
-
-.This document
-**********************************************************************
-This is an overly large document, it probably needs to be refactored
-into a Tutorial, Quick Reference and Formal Reference.
-
-If you're new to AsciiDoc read this section and the <> section and take a look at the example AsciiDoc (`*.txt`)
-source files in the distribution `doc` directory.
-**********************************************************************
-
-
-Introduction
-------------
-AsciiDoc is a plain text human readable/writable document format that
-can be translated to DocBook or HTML using the asciidoc(1) command.
-You can then either use asciidoc(1) generated HTML directly or run
-asciidoc(1) DocBook output through your favorite DocBook toolchain or
-use the AsciiDoc a2x(1) toolchain wrapper to produce PDF, EPUB, DVI,
-LaTeX, PostScript, man page, HTML and text formats.
-
-The AsciiDoc format is a useful presentation format in its own right:
-AsciiDoc markup is simple, intuitive and as such is easily proofed and
-edited.
-
-AsciiDoc is light weight: it consists of a single Python script and a
-bunch of configuration files. Apart from asciidoc(1) and a Python
-interpreter, no other programs are required to convert AsciiDoc text
-files to DocBook or HTML. See <>
-below.
-
-Text markup conventions tend to be a matter of (often strong) personal
-preference: if the default syntax is not to your liking you can define
-your own by editing the text based asciidoc(1) configuration files.
-You can also create configuration files to translate AsciiDoc
-documents to almost any SGML/XML markup.
-
-asciidoc(1) comes with a set of configuration files to translate
-AsciiDoc articles, books and man pages to HTML or DocBook backend
-formats.
-
-.My AsciiDoc Itch
-**********************************************************************
-DocBook has emerged as the de facto standard Open Source documentation
-format. But DocBook is a complex language, the markup is difficult to
-read and even more difficult to write directly -- I found I was
-spending more time typing markup tags, consulting reference manuals
-and fixing syntax errors, than I was writing the documentation.
-**********************************************************************
-
-
-[[X6]]
-Getting Started
----------------
-Installing AsciiDoc
-~~~~~~~~~~~~~~~~~~~
-See the `README` and `INSTALL` files for install prerequisites and
-procedures. Packagers take a look at <>.
-
-[[X11]]
-Example AsciiDoc Documents
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-The best way to quickly get a feel for AsciiDoc is to view the
-AsciiDoc web site and/or distributed examples:
-
-- Take a look at the linked examples on the AsciiDoc web site home
- page {website}. Press the 'Page Source' sidebar menu item to view
- corresponding AsciiDoc source.
-- Read the `*.txt` source files in the distribution `./doc` directory
- along with the corresponding HTML and DocBook XML files.
-
-
-AsciiDoc Document Types
------------------------
-There are three types of AsciiDoc documents: article, book and
-manpage. All document types share the same AsciiDoc format with some
-minor variations. If you are familiar with DocBook you will have
-noticed that AsciiDoc document types correspond to the same-named
-DocBook document types.
-
-Use the asciidoc(1) `-d` (`--doctype`) option to specify the AsciiDoc
-document type -- the default document type is 'article'.
-
-By convention the `.txt` file extension is used for AsciiDoc document
-source files.
-
-article
-~~~~~~~
-Used for short documents, articles and general documentation. See the
-AsciiDoc distribution `./doc/article.txt` example.
-
-AsciiDoc defines standard DocBook article frontmatter and backmatter
-<> (appendix, abstract, bibliography,
-glossary, index).
-
-book
-~~~~
-Books share the same format as articles, with the following
-differences:
-
-- The part titles in multi-part books are <>
- (same level as book title).
-- Some sections are book specific e.g. preface and colophon.
-
-Book documents will normally be used to produce DocBook output since
-DocBook processors can automatically generate footnotes, table of
-contents, list of tables, list of figures, list of examples and
-indexes.
-
-AsciiDoc defines standard DocBook book frontmatter and backmatter
-<> (appendix, dedication, preface,
-bibliography, glossary, index, colophon).
-
-.Example book documents
-Book::
- The `./doc/book.txt` file in the AsciiDoc distribution.
-
-Multi-part book::
- The `./doc/book-multi.txt` file in the AsciiDoc distribution.
-
-manpage
-~~~~~~~
-Used to generate roff format UNIX manual pages. AsciiDoc manpage
-documents observe special header title and section naming conventions
--- see the <> section for details.
-
-AsciiDoc defines the 'synopsis' <> to
-generate the DocBook `refsynopsisdiv` section.
-
-See also the asciidoc(1) man page source (`./doc/asciidoc.1.txt`) from
-the AsciiDoc distribution.
-
-
-[[X5]]
-AsciiDoc Backends
------------------
-The asciidoc(1) command translates an AsciiDoc formatted file to the
-backend format specified by the `-b` (`--backend`) command-line
-option. asciidoc(1) itself has little intrinsic knowledge of backend
-formats, all translation rules are contained in customizable cascading
-configuration files. Backend specific attributes are listed in the
-<> section.
-
-docbook45::
- Outputs DocBook XML 4.5 markup.
-
-html4::
- This backend generates plain HTML 4.01 Transitional markup.
-
-xhtml11::
- This backend generates XHTML 1.1 markup styled with CSS2. Output
- files have an `.html` extension.
-
-html5::
- This backend generates HTML 5 markup, apart from the inclusion of
- <> it is functionally identical to
- the 'xhtml11' backend.
-
-slidy::
- Use this backend to generate self-contained
- http://www.w3.org/Talks/Tools/Slidy2/[Slidy] HTML slideshows for
- your web browser from AsciiDoc documents. The Slidy backend is
- documented in the distribution `doc/slidy.txt` file and
- {website}slidy.html[online].
-
-wordpress::
- A minor variant of the 'html4' backend to support
- http://srackham.wordpress.com/blogpost1/[blogpost].
-
-latex::
- Experimental LaTeX backend.
-
-Backend Aliases
-~~~~~~~~~~~~~~~
-Backend aliases are alternative names for AsciiDoc backends. AsciiDoc
-comes with two backend aliases: 'html' (aliased to 'xhtml11') and
-'docbook' (aliased to 'docbook45').
-
-You can assign (or reassign) backend aliases by setting an AsciiDoc
-attribute named like `backend-alias-` to an AsciiDoc backend
-name. For example, the following backend alias attribute definitions
-appear in the `[attributes]` section of the global `asciidoc.conf`
-configuration file:
-
- backend-alias-html=xhtml11
- backend-alias-docbook=docbook45
-
-[[X100]]
-Backend Plugins
-~~~~~~~~~~~~~~~
-The asciidoc(1) `--backend` option is also used to install and manage
-backend <>.
-
-- A backend plugin is used just like the built-in backends.
-- Backend plugins <> over built-in backends with
- the same name.
-- You can use the `{asciidoc-confdir}` <> to
- refer to the built-in backend configuration file location from
- backend plugin configuration files.
-- You can use the `{backend-confdir}` <> to
- refer to the backend plugin configuration file location.
-- By default backends plugins are installed in
- `$HOME/.asciidoc/backends/` where `` is the
- backend name.
-
-
-DocBook
--------
-AsciiDoc generates 'article', 'book' and 'refentry'
-http://www.docbook.org/[DocBook] documents (corresponding to the
-AsciiDoc 'article', 'book' and 'manpage' document types).
-
-Most Linux distributions come with conversion tools (collectively
-called a toolchain) for <> to
-presentation formats such as Postscript, HTML, PDF, EPUB, DVI,
-PostScript, LaTeX, roff (the native man page format), HTMLHelp,
-JavaHelp and text. There are also programs that allow you to view
-DocBook files directly, for example http://live.gnome.org/Yelp[Yelp]
-(the GNOME help viewer).
-
-[[X12]]
-Converting DocBook to other file formats
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-DocBook files are validated, parsed and translated various
-presentation file formats using a combination of applications
-collectively called a DocBook 'tool chain'. The function of a tool
-chain is to read the DocBook markup (produced by AsciiDoc) and
-transform it to a presentation format (for example HTML, PDF, HTML
-Help, EPUB, DVI, PostScript, LaTeX).
-
-A wide range of user output format requirements coupled with a choice
-of available tools and stylesheets results in many valid tool chain
-combinations.
-
-[[X43]]
-a2x Toolchain Wrapper
-~~~~~~~~~~~~~~~~~~~~~
-One of the biggest hurdles for new users is installing, configuring
-and using a DocBook XML toolchain. `a2x(1)` can help -- it's a
-toolchain wrapper command that will generate XHTML (chunked and
-unchunked), PDF, EPUB, DVI, PS, LaTeX, man page, HTML Help and text
-file outputs from an AsciiDoc text file. `a2x(1)` does all the grunt
-work associated with generating and sequencing the toolchain commands
-and managing intermediate and output files. `a2x(1)` also optionally
-deploys admonition and navigation icons and a CSS stylesheet. See the
-`a2x(1)` man page for more details. In addition to `asciidoc(1)` you
-also need <>, <> and
-optionally: <> or <> (to generate PDF);
-`w3m(1)` or `lynx(1)` (to generate text).
-
-The following examples generate `doc/source-highlight-filter.pdf` from
-the AsciiDoc `doc/source-highlight-filter.txt` source file. The first
-example uses `dblatex(1)` (the default PDF generator) the second
-example forces FOP to be used:
-
- $ a2x -f pdf doc/source-highlight-filter.txt
- $ a2x -f pdf --fop doc/source-highlight-filter.txt
-
-See the `a2x(1)` man page for details.
-
-TIP: Use the `--verbose` command-line option to view executed
-toolchain commands.
-
-HTML generation
-~~~~~~~~~~~~~~~
-AsciiDoc produces nicely styled HTML directly without requiring a
-DocBook toolchain but there are also advantages in going the DocBook
-route:
-
-- HTML from DocBook can optionally include automatically generated
- indexes, tables of contents, footnotes, lists of figures and tables.
-- DocBook toolchains can also (optionally) generate separate (chunked)
- linked HTML pages for each document section.
-- Toolchain processing performs link and document validity checks.
-- If the DocBook 'lang' attribute is set then things like table of
- contents, figure and table captions and admonition captions will be
- output in the specified language (setting the AsciiDoc 'lang'
- attribute sets the DocBook 'lang' attribute).
-
-On the other hand, HTML output directly from AsciiDoc is much faster,
-is easily customized and can be used in situations where there is no
-suitable DocBook toolchain (for example, see the {website}[AsciiDoc
-website]).
-
-PDF generation
-~~~~~~~~~~~~~~
-There are two commonly used tools to generate PDFs from DocBook,
-<> and <>.
-
-.dblatex or FOP?
-- 'dblatex' is easier to install, there's zero configuration
- required and no Java VM to install -- it just works out of the box.
-- 'dblatex' source code highlighting and numbering is superb.
-- 'dblatex' is easier to use as it converts DocBook directly to PDF
- whereas before using 'FOP' you have to convert DocBook to XML-FO
- using <>.
-- 'FOP' is more feature complete (for example, callouts are processed
- inside literal layouts) and arguably produces nicer looking output.
-
-HTML Help generation
-~~~~~~~~~~~~~~~~~~~~
-. Convert DocBook XML documents to HTML Help compiler source files
- using <> and <>.
-. Convert the HTML Help source (`.hhp` and `.html`) files to HTML Help
- (`.chm`) files using the <>.
-
-Toolchain components summary
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-AsciiDoc::
- Converts AsciiDoc (`.txt`) files to DocBook XML (`.xml`) files.
-
-[[X13]]http://docbook.sourceforge.net/projects/xsl/[DocBook XSL Stylesheets]::
- These are a set of XSL stylesheets containing rules for converting
- DocBook XML documents to HTML, XSL-FO, manpage and HTML Help files.
- The stylesheets are used in conjunction with an XML parser such as
- <>.
-
-[[X40]]http://www.xmlsoft.org[xsltproc]::
- An XML parser for applying XSLT stylesheets (in our case the
- <>) to XML documents.
-
-[[X31]]http://dblatex.sourceforge.net/[dblatex]::
- Generates PDF, DVI, PostScript and LaTeX formats directly from
- DocBook source via the intermediate LaTeX typesetting language --
- uses <>, <> and
- `latex(1)`.
-
-[[X14]]http://xml.apache.org/fop/[FOP]::
- The Apache Formatting Objects Processor converts XSL-FO (`.fo`)
- files to PDF files. The XSL-FO files are generated from DocBook
- source files using <> and
- <>.
-
-[[X67]]Microsoft Help Compiler::
- The Microsoft HTML Help Compiler (`hhc.exe`) is a command-line tool
- that converts HTML Help source files to a single HTML Help (`.chm`)
- file. It runs on MS Windows platforms and can be downloaded from
- http://www.microsoft.com.
-
-AsciiDoc dblatex configuration files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The AsciiDoc distribution `./dblatex` directory contains
-`asciidoc-dblatex.xsl` (customized XSL parameter settings) and
-`asciidoc-dblatex.sty` (customized LaTeX settings). These are examples
-of optional <> output customization and are used by
-<>.
-
-AsciiDoc DocBook XSL Stylesheets drivers
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-You will have noticed that the distributed HTML and HTML Help
-documentation files (for example `./doc/asciidoc.html`) are not the
-plain outputs produced using the default 'DocBook XSL Stylesheets'
-configuration. This is because they have been processed using
-customized DocBook XSL Stylesheets along with (in the case of HTML
-outputs) the custom `./stylesheets/docbook-xsl.css` CSS stylesheet.
-
-You'll find the customized DocBook XSL drivers along with additional
-documentation in the distribution `./docbook-xsl` directory. The
-examples that follow are executed from the distribution documentation
-(`./doc`) directory. These drivers are also used by <>.
-
-`common.xsl`::
- Shared driver parameters. This file is not used directly but is
- included in all the following drivers.
-
-`chunked.xsl`::
- Generate chunked XHTML (separate HTML pages for each document
- section) in the `./doc/chunked` directory. For example:
-
- $ python ../asciidoc.py -b docbook asciidoc.txt
- $ xsltproc --nonet ../docbook-xsl/chunked.xsl asciidoc.xml
-
-`epub.xsl`::
- Used by <> to generate EPUB formatted documents.
-
-`fo.xsl`::
- Generate XSL Formatting Object (`.fo`) files for subsequent PDF
- file generation using FOP. For example:
-
- $ python ../asciidoc.py -b docbook article.txt
- $ xsltproc --nonet ../docbook-xsl/fo.xsl article.xml > article.fo
- $ fop article.fo article.pdf
-
-`htmlhelp.xsl`::
- Generate Microsoft HTML Help source files for the MS HTML Help
- Compiler in the `./doc/htmlhelp` directory. This example is run on
- MS Windows from a Cygwin shell prompt:
-
- $ python ../asciidoc.py -b docbook asciidoc.txt
- $ xsltproc --nonet ../docbook-xsl/htmlhelp.xsl asciidoc.xml
- $ c:/Program\ Files/HTML\ Help\ Workshop/hhc.exe htmlhelp.hhp
-
-`manpage.xsl`::
- Generate a `roff(1)` format UNIX man page from a DocBook XML
- 'refentry' document. This example generates an `asciidoc.1` man
- page file:
-
- $ python ../asciidoc.py -d manpage -b docbook asciidoc.1.txt
- $ xsltproc --nonet ../docbook-xsl/manpage.xsl asciidoc.1.xml
-
-`xhtml.xsl`::
- Convert a DocBook XML file to a single XHTML file. For example:
-
- $ python ../asciidoc.py -b docbook asciidoc.txt
- $ xsltproc --nonet ../docbook-xsl/xhtml.xsl asciidoc.xml > asciidoc.html
-
-If you want to see how the complete documentation set is processed
-take a look at the A-A-P script `./doc/main.aap`.
-
-
-Generating Plain Text Files
----------------------------
-AsciiDoc does not have a text backend (for most purposes AsciiDoc
-source text is fine), however you can convert AsciiDoc text files to
-formatted text using the AsciiDoc <> toolchain wrapper
-utility.
-
-
-[[X35]]
-HTML5 and XHTML 1.1
--------------------
-The 'xhtml11' and 'html5' backends embed or link CSS and JavaScript
-files in their outputs, there is also a <> plugin
-framework.
-
-- If the AsciiDoc 'linkcss' attribute is defined then CSS and
- JavaScript files are linked to the output document, otherwise they
- are embedded (the default behavior).
-- The default locations for CSS and JavaScript files can be changed by
- setting the AsciiDoc 'stylesdir' and 'scriptsdir' attributes
- respectively.
-- The default locations for embedded and linked files differ and are
- calculated at different times -- embedded files are loaded when
- asciidoc(1) generates the output document, linked files are loaded
- by the browser when the user views the output document.
-- Embedded files are automatically inserted in the output files but
- you need to manually copy linked CSS and Javascript files from
- AsciiDoc <> to the correct location
- relative to the output document.
-
-.Stylesheet file locations
-[cols="3*",frame="topbot",options="header"]
-|====================================================================
-|'stylesdir' attribute
-|Linked location ('linkcss' attribute defined)
-|Embedded location ('linkcss' attribute undefined)
-
-|Undefined (default).
-|Same directory as the output document.
-|`stylesheets` subdirectory in the AsciiDoc configuration directory
-(the directory containing the backend conf file).
-
-|Absolute or relative directory name.
-|Absolute or relative to the output document.
-|Absolute or relative to the AsciiDoc configuration directory (the
-directory containing the backend conf file).
-
-|====================================================================
-
-.JavaScript file locations
-[cols="3*",frame="topbot",options="header"]
-|====================================================================
-|'scriptsdir' attribute
-|Linked location ('linkcss' attribute defined)
-|Embedded location ('linkcss' attribute undefined)
-
-|Undefined (default).
-|Same directory as the output document.
-|`javascripts` subdirectory in the AsciiDoc configuration directory
-(the directory containing the backend conf file).
-
-|Absolute or relative directory name.
-|Absolute or relative to the output document.
-|Absolute or relative to the AsciiDoc configuration directory (the
-directory containing the backend conf file).
-
-|====================================================================
-
-[[X99]]
-Themes
-~~~~~~
-The AsciiDoc 'theme' attribute is used to select an alternative CSS
-stylesheet and to optionally include additional JavaScript code.
-
-- Theme files reside in an AsciiDoc <>
- named `themes//` (where `` is the the theme name set
- by the 'theme' attribute). asciidoc(1) sets the 'themedir' attribute
- to the theme directory path name.
-- The 'theme' attribute can also be set using the asciidoc(1)
- `--theme` option, the `--theme` option can also be used to manage
- theme <>.
-- AsciiDoc ships with two themes: 'flask' and 'volnitsky'.
-- The `.css` file replaces the default `asciidoc.css` CSS file.
-- The `.js` file is included in addition to the default
- `asciidoc.js` JavaScript file.
-- If the <> attribute is defined then icons are loaded
- from the theme `icons` sub-directory if it exists (i.e. the
- 'iconsdir' attribute is set to theme `icons` sub-directory path).
-- Embedded theme files are automatically inserted in the output files
- but you need to manually copy linked CSS and Javascript files to the
- location of the output documents.
-- Linked CSS and JavaScript theme files are linked to the same linked
- locations as <>.
-
-For example, the command-line option `--theme foo` (or `--attribute
-theme=foo`) will cause asciidoc(1) to search <<"X27","configuration
-file locations 1, 2 and 3">> for a sub-directory called `themes/foo`
-containing the stylesheet `foo.css` and optionally a JavaScript file
-name `foo.js`.
-
-
-Document Structure
-------------------
-An AsciiDoc document consists of a series of <>
-starting with an optional document Header, followed by an optional
-Preamble, followed by zero or more document Sections.
-
-Almost any combination of zero or more elements constitutes a valid
-AsciiDoc document: documents can range from a single sentence to a
-multi-part book.
-
-Block Elements
-~~~~~~~~~~~~~~
-Block elements consist of one or more lines of text and may contain
-other block elements.
-
-The AsciiDoc block structure can be informally summarized as follows
-footnote:[This is a rough structural guide, not a rigorous syntax
-definition]:
-
- Document ::= (Header?,Preamble?,Section*)
- Header ::= (Title,(AuthorInfo,RevisionInfo?)?)
- AuthorInfo ::= (FirstName,(MiddleName?,LastName)?,EmailAddress?)
- RevisionInfo ::= (RevisionNumber?,RevisionDate,RevisionRemark?)
- Preamble ::= (SectionBody)
- Section ::= (Title,SectionBody?,(Section)*)
- SectionBody ::= ((BlockTitle?,Block)|BlockMacro)+
- Block ::= (Paragraph|DelimitedBlock|List|Table)
- List ::= (BulletedList|NumberedList|LabeledList|CalloutList)
- BulletedList ::= (ListItem)+
- NumberedList ::= (ListItem)+
- CalloutList ::= (ListItem)+
- LabeledList ::= (ListEntry)+
- ListEntry ::= (ListLabel,ListItem)
- ListLabel ::= (ListTerm+)
- ListItem ::= (ItemText,(List|ListParagraph|ListContinuation)*)
-
-Where:
-
-- '?' implies zero or one occurrence, '+' implies one or more
- occurrences, '*' implies zero or more occurrences.
-- All block elements are separated by line boundaries.
-- `BlockId`, `AttributeEntry` and `AttributeList` block elements (not
- shown) can occur almost anywhere.
-- There are a number of document type and backend specific
- restrictions imposed on the block syntax.
-- The following elements cannot contain blank lines: Header, Title,
- Paragraph, ItemText.
-- A ListParagraph is a Paragraph with its 'listelement' option set.
-- A ListContinuation is a <>.
-
-[[X95]]
-Header
-~~~~~~
-The Header contains document meta-data, typically title plus optional
-authorship and revision information:
-
-- The Header is optional, but if it is used it must start with a
- document <>.
-- Optional Author and Revision information immediately follows the
- header title.
-- The document header must be separated from the remainder of the
- document by one or more blank lines and cannot contain blank lines.
-- The header can include comments.
-- The header can include <>, typically
- 'doctype', 'lang', 'encoding', 'icons', 'data-uri', 'toc',
- 'numbered'.
-- Header attributes are overridden by command-line attributes.
-- If the header contains non-UTF-8 characters then the 'encoding' must
- precede the header (either in the document or on the command-line).
-
-Here's an example AsciiDoc document header:
-
- Writing Documentation using AsciiDoc
- ====================================
- Joe Bloggs
- v2.0, February 2003:
- Rewritten for version 2 release.
-
-The author information line contains the author's name optionally
-followed by the author's email address. The author's name is formatted
-like:
-
- firstname[ [middlename ]lastname][ ]]
-
-i.e. a first name followed by optional middle and last names followed
-by an email address in that order. Multi-word first, middle and last
-names can be entered using the underscore as a word separator. The
-email address comes last and must be enclosed in angle <> brackets.
-Here a some examples of author information lines:
-
- Joe Bloggs
- Joe Bloggs
- Vincent Willem van_Gogh
-
-If the author line does not match the above specification then the
-entire author line is treated as the first name.
-
-The optional revision information line follows the author information
-line. The revision information can be one of two formats:
-
-. An optional document revision number followed by an optional
- revision date followed by an optional revision remark:
-+
---
- * If the revision number is specified it must be followed by a
- comma.
- * The revision number must contain at least one numeric character.
- * Any non-numeric characters preceding the first numeric character
- will be dropped.
- * If a revision remark is specified it must be preceded by a colon.
- The revision remark extends from the colon up to the next blank
- line, attribute entry or comment and is subject to normal text
- substitutions.
- * If a revision number or remark has been set but the revision date
- has not been set then the revision date is set to the value of the
- 'docdate' attribute.
-
-Examples:
-
- v2.0, February 2003
- February 2003
- v2.0,
- v2.0, February 2003: Rewritten for version 2 release.
- February 2003: Rewritten for version 2 release.
- v2.0,: Rewritten for version 2 release.
- :Rewritten for version 2 release.
---
-
-. The revision information line can also be an RCS/CVS/SVN $Id$
- marker:
-+
---
- * AsciiDoc extracts the 'revnumber', 'revdate', and 'author'
- attributes from the $Id$ revision marker and displays them in the
- document header.
- * If an $Id$ revision marker is used the header author line can be
- omitted.
-
-Example:
-
- $Id: mydoc.txt,v 1.5 2009/05/17 17:58:44 jbloggs Exp $
---
-
-You can override or set header parameters by passing 'revnumber',
-'revremark', 'revdate', 'email', 'author', 'authorinitials',
-'firstname' and 'lastname' attributes using the asciidoc(1) `-a`
-(`--attribute`) command-line option. For example:
-
- $ asciidoc -a revdate=2004/07/27 article.txt
-
-Attribute entries can also be added to the header for substitution in
-the header template with <> elements.
-
-The 'title' element in HTML outputs is set to the AsciiDoc document
-title, you can set it to a different value by including a 'title'
-attribute entry in the document header.
-
-[[X87]]
-Additional document header information
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-AsciiDoc has two mechanisms for optionally including additional
-meta-data in the header of the output document:
-
-'docinfo' configuration file sections::
-If a <> section named 'docinfo' has been loaded
-then it will be included in the document header. Typically the
-'docinfo' section name will be prefixed with a '+' character so that it
-is appended to (rather than replace) other 'docinfo' sections.
-
-'docinfo' files::
-Two docinfo files are recognized: one named `docinfo` and a second
-named like the AsciiDoc source file with a `-docinfo` suffix. For
-example, if the source document is called `mydoc.txt` then the
-document information files would be `docinfo.xml` and
-`mydoc-docinfo.xml` (for DocBook outputs) and `docinfo.html` and
-`mydoc-docinfo.html` (for HTML outputs). The <> attributes control which docinfo files are included in
-the output files.
-
-The contents docinfo templates and files is dependent on the type of
-output:
-
-HTML::
- Valid 'head' child elements. Typically 'style' and 'script' elements
- for CSS and JavaScript inclusion.
-
-DocBook::
- Valid 'articleinfo' or 'bookinfo' child elements. DocBook defines
- numerous elements for document meta-data, for example: copyrights,
- document history and authorship information. See the DocBook
- `./doc/article-docinfo.xml` example that comes with the AsciiDoc
- distribution. The rendering of meta-data elements (or not) is
- DocBook processor dependent.
-
-
-[[X86]]
-Preamble
-~~~~~~~~
-The Preamble is an optional untitled section body between the document
-Header and the first Section title.
-
-Sections
-~~~~~~~~
-In addition to the document title (level 0), AsciiDoc supports four
-section levels: 1 (top) to 4 (bottom). Section levels are delimited
-by section <>. Sections are translated using
-configuration file <>. AsciiDoc
-generates the following <> specifically for
-use in section markup templates:
-
-level::
-The `level` attribute is the section level number, it is normally just
-the <> level number (1..4). However, if the `leveloffset`
-attribute is defined it will be added to the `level` attribute. The
-`leveloffset` attribute is useful for <>.
-
-sectnum::
-The `-n` (`--section-numbers`) command-line option generates the
-`sectnum` (section number) attribute. The `sectnum` attribute is used
-for section numbers in HTML outputs (DocBook section numbering are
-handled automatically by the DocBook toolchain commands).
-
-[[X93]]
-Section markup templates
-^^^^^^^^^^^^^^^^^^^^^^^^
-Section markup templates specify output markup and are defined in
-AsciiDoc configuration files. Section markup template names are
-derived as follows (in order of precedence):
-
-1. From the title's first positional attribute or 'template'
- attribute. For example, the following three section titles are
- functionally equivalent:
-+
-.....................................................................
-[[terms]]
-[glossary]
-List of Terms
--------------
-
-["glossary",id="terms"]
-List of Terms
--------------
-
-[template="glossary",id="terms"]
-List of Terms
--------------
-.....................................................................
-
-2. When the title text matches a configuration file
- <> entry.
-3. If neither of the above the default `sect` template is used
- (where `` is a number from 1 to 4).
-
-In addition to the normal section template names ('sect1', 'sect2',
-'sect3', 'sect4') AsciiDoc has the following templates for
-frontmatter, backmatter and other special sections: 'abstract',
-'preface', 'colophon', 'dedication', 'glossary', 'bibliography',
-'synopsis', 'appendix', 'index'. These special section templates
-generate the corresponding Docbook elements; for HTML outputs they
-default to the 'sect1' section template.
-
-Section IDs
-^^^^^^^^^^^
-If no explicit section ID is specified an ID will be synthesised from
-the section title. The primary purpose of this feature is to ensure
-persistence of table of contents links (permalinks): the missing
-section IDs are generated dynamically by the JavaScript TOC generator
-*after* the page is loaded. If you link to a dynamically generated TOC
-address the page will load but the browser will ignore the (as yet
-ungenerated) section ID.
-
-The IDs are generated by the following algorithm:
-
-- Replace all non-alphanumeric title characters with underscores.
-- Strip leading or trailing underscores.
-- Convert to lowercase.
-- Prepend the `idprefix` attribute (so there's no possibility of name
- clashes with existing document IDs). Prepend an underscore if the
- `idprefix` attribute is not defined.
-- A numbered suffix (`_2`, `_3` ...) is added if a same named
- auto-generated section ID exists.
-- If the `ascii-ids` attribute is defined then non-ASCII characters
- are replaced with ASCII equivalents. This attribute may be
- deprecated in future releases and *should be avoided*, it's sole
- purpose is to accommodate deficient downstream applications that
- cannot process non-ASCII ID attributes.
-
-Example: the title 'Jim's House' would generate the ID `_jim_s_house`.
-
-Section ID synthesis can be disabled by undefining the `sectids`
-attribute.
-
-[[X16]]
-Special Section Titles
-^^^^^^^^^^^^^^^^^^^^^^
-AsciiDoc has a mechanism for mapping predefined section titles
-auto-magically to specific markup templates. For example a title
-'Appendix A: Code Reference' will automatically use the 'appendix'
-<>. The mappings from title to template
-name are specified in `[specialsections]` sections in the Asciidoc
-language configuration files (`lang-*.conf`). Section entries are
-formatted like:
-
- =
-
-`` is a Python regular expression and `` is the name
-of a configuration file markup template section. If the ``
-matches an AsciiDoc document section title then the backend output is
-marked up using the `` markup template (instead of the
-default `sect` section template). The `{title}` attribute value
-is set to the value of the matched regular expression group named
-'title', if there is no 'title' group `{title}` defaults to the whole
-of the AsciiDoc section title. If `` is blank then any
-existing entry with the same `` will be deleted.
-
-.Special section titles vs. explicit template names
-*********************************************************************
-AsciiDoc has two mechanisms for specifying non-default section markup
-templates: you can specify the template name explicitly (using the
-'template' attribute) or indirectly (using 'special section titles').
-Specifying a <> attribute explicitly is
-preferred. Auto-magical 'special section titles' have the following
-drawbacks:
-
-- They are non-obvious, you have to know the exact matching
- title for each special section on a language by language basis.
-- Section titles are predefined and can only be customised with a
- configuration change.
-- The implementation is complicated by multiple languages: every
- special section title has to be defined for each language (in each
- of the `lang-*.conf` files).
-
-Specifying special section template names explicitly does add more
-noise to the source document (the 'template' attribute declaration),
-but the intention is obvious and the syntax is consistent with other
-AsciiDoc elements c.f. bibliographic, Q&A and glossary lists.
-
-Special section titles have been deprecated but are retained for
-backward compatibility.
-
-*********************************************************************
-
-Inline Elements
-~~~~~~~~~~~~~~~
-<> are used to format text and to
-perform various types of text substitution. Inline elements and inline
-element syntax is defined in the asciidoc(1) configuration files.
-
-Here is a list of AsciiDoc inline elements in the (default) order in
-which they are processed:
-
-Special characters::
- These character sequences escape special characters used by
- the backend markup (typically `<`, `>`, and `&` characters).
- See `[specialcharacters]` configuration file sections.
-
-Quotes::
- Elements that markup words and phrases; usually for character
- formatting. See `[quotes]` configuration file sections.
-
-Special Words::
- Word or word phrase patterns singled out for markup without
- the need for further annotation. See `[specialwords]`
- configuration file sections.
-
-Replacements::
- Each replacement defines a word or word phrase pattern to
- search for along with corresponding replacement text. See
- `[replacements]` configuration file sections.
-
-Attribute references::
- Document attribute names enclosed in braces are replaced by
- the corresponding attribute value.
-
-Inline Macros::
- Inline macros are replaced by the contents of parametrized
- configuration file sections.
-
-
-Document Processing
--------------------
-The AsciiDoc source document is read and processed as follows:
-
-1. The document 'Header' is parsed, header parameter values are
- substituted into the configuration file `[header]` template section
- which is then written to the output file.
-2. Each document 'Section' is processed and its constituent elements
- translated to the output file.
-3. The configuration file `[footer]` template section is substituted
- and written to the output file.
-
-When a block element is encountered asciidoc(1) determines the type of
-block by checking in the following order (first to last): (section)
-Titles, BlockMacros, Lists, DelimitedBlocks, Tables, AttributeEntrys,
-AttributeLists, BlockTitles, Paragraphs.
-
-The default paragraph definition `[paradef-default]` is last element
-to be checked.
-
-Knowing the parsing order will help you devise unambiguous macro, list
-and block syntax rules.
-
-Inline substitutions within block elements are performed in the
-following default order:
-
-1. Special characters
-2. Quotes
-3. Special words
-4. Replacements
-5. Attributes
-6. Inline Macros
-7. Replacements2
-
-The substitutions and substitution order performed on
-Title, Paragraph and DelimitedBlock elements is determined by
-configuration file parameters.
-
-
-Text Formatting
----------------
-[[X51]]
-Quoted Text
-~~~~~~~~~~~
-Words and phrases can be formatted by enclosing inline text with
-quote characters:
-
-_Emphasized text_::
- Word phrases \'enclosed in single quote characters' (acute
- accents) or \_underline characters_ are emphasized.
-
-*Strong text*::
- Word phrases \*enclosed in asterisk characters* are rendered
- in a strong font (usually bold).
-
-[[X81]]+Monospaced text+::
- Word phrases \+enclosed in plus characters+ are rendered in a
- monospaced font. Word phrases \`enclosed in backtick
- characters` (grave accents) are also rendered in a monospaced
- font but in this case the enclosed text is rendered literally
- and is not subject to further expansion (see <>).
-
-`Single quoted text'::
- Phrases enclosed with a \`single grave accent to the left and
- a single acute accent to the right' are rendered in single
- quotation marks.
-
-``Double quoted text''::
- Phrases enclosed with \\``two grave accents to the left and
- two acute accents to the right'' are rendered in quotation
- marks.
-
-#Unquoted text#::
- Placing \#hashes around text# does nothing, it is a mechanism
- to allow inline attributes to be applied to otherwise
- unformatted text.
-
-New quote types can be defined by editing asciidoc(1) configuration
-files. See the <> section for details.
-
-.Quoted text behavior
-- Quoting cannot be overlapped.
-- Different quoting types can be nested.
-- To suppress quoted text formatting place a backslash character
- immediately in front of the leading quote character(s). In the case
- of ambiguity between escaped and non-escaped text you will need to
- escape both leading and trailing quotes, in the case of
- multi-character quotes you may even need to escape individual
- characters.
-
-[[X96]]
-Quoted text attributes
-^^^^^^^^^^^^^^^^^^^^^^
-Quoted text can be prefixed with an <>. The first
-positional attribute ('role' attribute) is translated by AsciiDoc to
-an HTML 'span' element 'class' attribute or a DocBook 'phrase' element
-'role' attribute.
-
-DocBook XSL Stylesheets translate DocBook 'phrase' elements with
-'role' attributes to corresponding HTML 'span' elements with the same
-'class' attributes; CSS can then be used
-http://www.sagehill.net/docbookxsl/UsingCSS.html[to style the
-generated HTML]. Thus CSS styling can be applied to both DocBook and
-AsciiDoc generated HTML outputs. You can also specify multiple class
-names separated by spaces.
-
-CSS rules for text color, text background color, text size and text
-decorators are included in the distributed AsciiDoc CSS files and are
-used in conjunction with AsciiDoc 'xhtml11', 'html5' and 'docbook'
-outputs. The CSS class names are:
-
-- '' (text foreground color).
-- '-background' (text background color).
-- 'big' and 'small' (text size).
-- 'underline', 'overline' and 'line-through' (strike through) text
- decorators.
-
-Where '' can be any of the
-http://en.wikipedia.org/wiki/Web_colors#HTML_color_names[sixteen HTML
-color names]. Examples:
-
- [red]#Obvious# and [big red yellow-background]*very obvious*.
-
- [underline]#Underline text#, [overline]#overline text# and
- [blue line-through]*bold blue and line-through*.
-
-is rendered as:
-
-[red]#Obvious# and [big red yellow-background]*very obvious*.
-
-[underline]#Underline text#, [overline]#overline text# and
-[bold blue line-through]*bold blue and line-through*.
-
-NOTE: Color and text decorator attributes are rendered for XHTML and
-HTML 5 outputs using CSS stylesheets. The mechanism to implement
-color and text decorator attributes is provided for DocBook toolchains
-via the DocBook 'phrase' element 'role' attribute, but the actual
-rendering is toolchain specific and is not part of the AsciiDoc
-distribution.
-
-[[X52]]
-Constrained and Unconstrained Quotes
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-There are actually two types of quotes:
-
-Constrained quotes
-++++++++++++++++++
-Quoted must be bounded by white space or commonly adjoining
-punctuation characters. These are the most commonly used type of
-quote.
-
-Unconstrained quotes
-++++++++++++++++++++
-Unconstrained quotes have no boundary constraints and can be placed
-anywhere within inline text. For consistency and to make them easier
-to remember unconstrained quotes are double-ups of the `_`, `*`, `+`
-and `#` constrained quotes:
-
- __unconstrained emphasized text__
- **unconstrained strong text**
- ++unconstrained monospaced text++
- ##unconstrained unquoted text##
-
-The following example emboldens the letter F:
-
- **F**ile Open...
-
-Superscripts and Subscripts
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Put \^carets on either^ side of the text to be superscripted, put
-\~tildes on either side~ of text to be subscripted. For example, the
-following line:
-
- e^πi^+1 = 0. H~2~O and x^10^. Some ^super text^
- and ~some sub text~
-
-Is rendered like:
-
-e^πi^+1 = 0. H~2~O and x^10^. Some ^super text^
-and ~some sub text~
-
-Superscripts and subscripts are implemented as <> and they can be escaped with a leading backslash and prefixed
-with with an attribute list.
-
-Line Breaks
-~~~~~~~~~~~
-A plus character preceded by at least one space character at the end
-of a non-blank line forces a line break. It generates a line break
-(`br`) tag for HTML outputs and a custom XML `asciidoc-br` processing
-instruction for DocBook outputs. The `asciidoc-br` processing
-instruction is handled by <>.
-
-Page Breaks
-~~~~~~~~~~~
-A line of three or more less-than (`<<<`) characters will generate a
-hard page break in DocBook and printed HTML outputs. It uses the CSS
-`page-break-after` property for HTML outputs and a custom XML
-`asciidoc-pagebreak` processing instruction for DocBook outputs. The
-`asciidoc-pagebreak` processing instruction is handled by
-<>. Hard page breaks are sometimes handy but as a general
-rule you should let your page processor generate page breaks for you.
-
-Rulers
-~~~~~~
-A line of three or more apostrophe characters will generate a ruler
-line. It generates a ruler (`hr`) tag for HTML outputs and a custom
-XML `asciidoc-hr` processing instruction for DocBook outputs. The
-`asciidoc-hr` processing instruction is handled by <>.
-
-Tabs
-~~~~
-By default tab characters input files will translated to 8 spaces. Tab
-expansion is set with the 'tabsize' entry in the configuration file
-`[miscellaneous]` section and can be overridden in included files by
-setting a 'tabsize' attribute in the `include` macro's attribute list.
-For example:
-
- include::addendum.txt[tabsize=2]
-
-The tab size can also be set using the attribute command-line option,
-for example `--attribute tabsize=4`
-
-Replacements
-~~~~~~~~~~~~
-The following replacements are defined in the default AsciiDoc
-configuration:
-
- (C) copyright, (TM) trademark, (R) registered trademark,
- -- em dash, ... ellipsis, -> right arrow, <- left arrow, => right
- double arrow, <= left double arrow.
-
-Which are rendered as:
-
-(C) copyright, (TM) trademark, (R) registered trademark,
--- em dash, ... ellipsis, -> right arrow, <- left arrow, => right
-double arrow, <= left double arrow.
-
-You can also include arbitrary entity references in the AsciiDoc
-source. Examples:
-
- ➊ ¶
-
-renders:
-
-➊ ¶
-
-To render a replacement literally escape it with a leading back-slash.
-
-The <> section explains how to configure your
-own replacements.
-
-Special Words
-~~~~~~~~~~~~~
-Words defined in `[specialwords]` configuration file sections are
-automatically marked up without having to be explicitly notated.
-
-The <> section explains how to add and replace
-special words.
-
-
-[[X17]]
-Titles
-------
-Document and section titles can be in either of two formats:
-
-Two line titles
-~~~~~~~~~~~~~~~
-A two line title consists of a title line, starting hard against the
-left margin, and an underline. Section underlines consist a repeated
-character pairs spanning the width of the preceding title (give or
-take up to two characters):
-
-The default title underlines for each of the document levels are:
-
-
- Level 0 (top level): ======================
- Level 1: ----------------------
- Level 2: ~~~~~~~~~~~~~~~~~~~~~~
- Level 3: ^^^^^^^^^^^^^^^^^^^^^^
- Level 4 (bottom level): ++++++++++++++++++++++
-
-Examples:
-
- Level One Section Title
- -----------------------
-
- Level 2 Subsection Title
- ~~~~~~~~~~~~~~~~~~~~~~~~
-
-[[X46]]
-One line titles
-~~~~~~~~~~~~~~~
-One line titles consist of a single line delimited on either side by
-one or more equals characters (the number of equals characters
-corresponds to the section level minus one). Here are some examples:
-
- = Document Title (level 0) =
- == Section title (level 1) ==
- === Section title (level 2) ===
- ==== Section title (level 3) ====
- ===== Section title (level 4) =====
-
-[NOTE]
-=====================================================================
-- One or more spaces must fall between the title and the delimiters.
-- The trailing title delimiter is optional.
-- The one-line title syntax can be changed by editing the
- configuration file `[titles]` section `sect0`...`sect4` entries.
-=====================================================================
-
-Floating titles
-~~~~~~~~~~~~~~~
-Setting the title's first positional attribute or 'style' attribute to
-'float' generates a free-floating title. A free-floating title is
-rendered just like a normal section title but is not formally
-associated with a text body and is not part of the regular section
-hierarchy so the normal ordering rules do not apply. Floating titles
-can also be used in contexts where section titles are illegal: for
-example sidebar and admonition blocks. Example:
-
- [float]
- The second day
- ~~~~~~~~~~~~~~
-
-Floating titles do not appear in a document's table of contents.
-
-
-[[X42]]
-Block Titles
-------------
-A 'BlockTitle' element is a single line beginning with a period
-followed by the title text. A BlockTitle is applied to the immediately
-following Paragraph, DelimitedBlock, List, Table or BlockMacro. For
-example:
-
-........................
-.Notes
-- Note 1.
-- Note 2.
-........................
-
-is rendered as:
-
-.Notes
-- Note 1.
-- Note 2.
-
-
-[[X41]]
-BlockId Element
----------------
-A 'BlockId' is a single line block element containing a unique
-identifier enclosed in double square brackets. It is used to assign an
-identifier to the ensuing block element. For example:
-
- [[chapter-titles]]
- Chapter titles can be ...
-
-The preceding example identifies the ensuing paragraph so it can be
-referenced from other locations, for example with
-`<>`.
-
-'BlockId' elements can be applied to Title, Paragraph, List,
-DelimitedBlock, Table and BlockMacro elements. The BlockId element
-sets the `{id}` attribute for substitution in the subsequent block's
-markup template. If a second positional argument is supplied it sets
-the `{reftext}` attribute which is used to set the DocBook `xreflabel`
-attribute.
-
-The 'BlockId' element has the same syntax and serves the same function
-to the <>.
-
-[[X79]]
-AttributeList Element
----------------------
-An 'AttributeList' block element is an <> on a
-line by itself:
-
-- 'AttributeList' attributes are only applied to the immediately
- following block element -- the attributes are made available to the
- block's markup template.
-- Multiple contiguous 'AttributeList' elements are additively combined
- in the order they appear..
-- The first positional attribute in the list is often used to specify
- the ensuing element's <>.
-
-Attribute value substitution
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-By default, only substitutions that take place inside attribute list
-values are attribute references, this is because not all attributes
-are destined to be marked up and rendered as text (for example the
-table 'cols' attribute). To perform normal inline text substitutions
-(special characters, quotes, macros, replacements) on an attribute
-value you need to enclose it in single quotes. In the following quote
-block the second attribute value in the AttributeList is quoted to
-ensure the 'http' macro is expanded to a hyperlink.
-
----------------------------------------------------------------------
-[quote,'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]']
-_____________________________________________________________________
-Sir, a woman's preaching is like a dog's walking on his hind legs. It
-is not done well; but you are surprised to find it done at all.
-_____________________________________________________________________
----------------------------------------------------------------------
-
-Common attributes
-~~~~~~~~~~~~~~~~~
-Most block elements support the following attributes:
-
-[cols="1e,1,5a",frame="topbot",options="header"]
-|====================================================================
-|Name |Backends |Description
-
-|id |html4, html5, xhtml11, docbook |
-Unique identifier typically serve as link targets.
-Can also be set by the 'BlockId' element.
-
-|role |html4, html5, xhtml11, docbook |
-Role contains a string used to classify or subclassify an element and
-can be applied to AsciiDoc block elements. The AsciiDoc 'role'
-attribute is translated to the 'role' attribute in DocBook outputs and
-is included in the 'class' attribute in HTML outputs, in this respect
-it behaves like the <>.
-
-DocBook XSL Stylesheets translate DocBook 'role' attributes to HTML
-'class' attributes; CSS can then be used
-http://www.sagehill.net/docbookxsl/UsingCSS.html[to style the
-generated HTML].
-
-|reftext |docbook |
-'reftext' is used to set the DocBook 'xreflabel' attribute.
-The 'reftext' attribute can an also be set by the 'BlockId' element.
-
-|====================================================================
-
-
-Paragraphs
-----------
-Paragraphs are blocks of text terminated by a blank line, the end of
-file, or the start of a delimited block or a list. There are three
-paragraph syntaxes: normal, indented (literal) and admonition which
-are rendered, by default, with the corresponding paragraph style.
-
-Each syntax has a default style, but you can explicitly apply any
-paragraph style to any paragraph syntax. You can also apply
-<> styles to single paragraphs.
-
-The built-in paragraph styles are: 'normal', 'literal', 'verse',
-'quote', 'listing', 'TIP', 'NOTE', 'IMPORTANT', 'WARNING', 'CAUTION',
-'abstract', 'partintro', 'comment', 'example', 'sidebar', 'source',
-'music', 'latex', 'graphviz'.
-
-normal paragraph syntax
-~~~~~~~~~~~~~~~~~~~~~~~
-Normal paragraph syntax consists of one or more non-blank lines of
-text. The first line must start hard against the left margin (no
-intervening white space). The default processing expectation is that
-of a normal paragraph of text.
-
-[[X85]]
-literal paragraph syntax
-~~~~~~~~~~~~~~~~~~~~~~~~
-Literal paragraphs are rendered verbatim in a monospaced font without
-any distinguishing background or border. By default there is no text
-formatting or substitutions within Literal paragraphs apart from
-Special Characters and Callouts.
-
-The 'literal' style is applied implicitly to indented paragraphs i.e.
-where the first line of the paragraph is indented by one or more space
-or tab characters. For example:
-
----------------------------------------------------------------------
- Consul *necessitatibus* per id,
- consetetur, eu pro everti postulant
- homero verear ea mea, qui.
----------------------------------------------------------------------
-
-Renders:
-
- Consul *necessitatibus* per id,
- consetetur, eu pro everti postulant
- homero verear ea mea, qui.
-
-NOTE: Because <> can be indented it's possible for your
-indented paragraph to be misinterpreted as a list -- in situations
-like this apply the 'literal' style to a normal paragraph.
-
-Instead of using a paragraph indent you could apply the 'literal'
-style explicitly, for example:
-
----------------------------------------------------------------------
-[literal]
-Consul *necessitatibus* per id,
-consetetur, eu pro everti postulant
-homero verear ea mea, qui.
----------------------------------------------------------------------
-
-Renders:
-
-[literal]
-Consul *necessitatibus* per id,
-consetetur, eu pro everti postulant
-homero verear ea mea, qui.
-
-[[X94]]
-quote and verse paragraph styles
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The optional 'attribution' and 'citetitle' attributes (positional
-attributes 2 and 3) specify the author and source respectively.
-
-The 'verse' style retains the line breaks, for example:
-
----------------------------------------------------------------------
-[verse, William Blake, from Auguries of Innocence]
-To see a world in a grain of sand,
-And a heaven in a wild flower,
-Hold infinity in the palm of your hand,
-And eternity in an hour.
----------------------------------------------------------------------
-
-Which is rendered as:
-
-[verse, William Blake, from Auguries of Innocence]
-To see a world in a grain of sand,
-And a heaven in a wild flower,
-Hold infinity in the palm of your hand,
-And eternity in an hour.
-
-The 'quote' style flows the text at left and right margins, for
-example:
-
----------------------------------------------------------------------
-[quote, Bertrand Russell, The World of Mathematics (1956)]
-A good notation has subtlety and suggestiveness which at times makes
-it almost seem like a live teacher.
----------------------------------------------------------------------
-
-Which is rendered as:
-
-[quote, Bertrand Russell, The World of Mathematics (1956)]
-A good notation has subtlety and suggestiveness which at times makes
-it almost seem like a live teacher.
-
-[[X28]]
-Admonition Paragraphs
-~~~~~~~~~~~~~~~~~~~~~
-'TIP', 'NOTE', 'IMPORTANT', 'WARNING' and 'CAUTION' admonishment
-paragraph styles are generated by placing `NOTE:`, `TIP:`,
-`IMPORTANT:`, `WARNING:` or `CAUTION:` as the first word of the
-paragraph. For example:
-
- NOTE: This is an example note.
-
-Alternatively, you can specify the paragraph admonition style
-explicitly using an <>. For example:
-
- [NOTE]
- This is an example note.
-
-Renders:
-
-NOTE: This is an example note.
-
-TIP: If your admonition requires more than a single paragraph use an
-<> instead.
-
-[[X47]]
-Admonition Icons and Captions
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-NOTE: Admonition customization with `icons`, `iconsdir`, `icon` and
-`caption` attributes does not apply when generating DocBook output. If
-you are going the DocBook route then the <> `--no-icons`
-and `--icons-dir` options can be used to set the appropriate XSL
-Stylesheets parameters.
-
-By default the asciidoc(1) HTML backends generate text captions
-instead of admonition icon image links. To generate links to icon
-images define the <> attribute, for example using the `-a
-icons` command-line option.
-
-The <> attribute sets the location of linked icon
-images.
-
-You can override the default icon image using the `icon` attribute to
-specify the path of the linked image. For example:
-
- [icon="./images/icons/wink.png"]
- NOTE: What lovely war.
-
-Use the `caption` attribute to customize the admonition captions (not
-applicable to `docbook` backend). The following example suppresses the
-icon image and customizes the caption of a 'NOTE' admonition
-(undefining the `icons` attribute with `icons=None` is only necessary
-if <> have been enabled):
-
- [icons=None, caption="My Special Note"]
- NOTE: This is my special note.
-
-This subsection also applies to <>.
-
-
-[[X104]]
-Delimited Blocks
-----------------
-Delimited blocks are blocks of text enveloped by leading and trailing
-delimiter lines (normally a series of four or more repeated
-characters). The behavior of Delimited Blocks is specified by entries
-in configuration file `[blockdef-*]` sections.
-
-Predefined Delimited Blocks
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-AsciiDoc ships with a number of predefined DelimitedBlocks (see the
-`asciidoc.conf` configuration file in the asciidoc(1) program
-directory):
-
-Predefined delimited block underlines:
-
- CommentBlock: //////////////////////////
- PassthroughBlock: ++++++++++++++++++++++++++
- ListingBlock: --------------------------
- LiteralBlock: ..........................
- SidebarBlock: **************************
- QuoteBlock: __________________________
- ExampleBlock: ==========================
- OpenBlock: --
-
-.Default DelimitedBlock substitutions
-[cols="2e,7*^",frame="topbot",options="header,autowidth"]
-|=====================================================
-| |Attributes |Callouts |Macros | Quotes |Replacements
-|Special chars |Special words
-
-|PassthroughBlock |Yes |No |Yes |No |No |No |No
-|ListingBlock |No |Yes |No |No |No |Yes |No
-|LiteralBlock |No |Yes |No |No |No |Yes |No
-|SidebarBlock |Yes |No |Yes |Yes |Yes |Yes |Yes
-|QuoteBlock |Yes |No |Yes |Yes |Yes |Yes |Yes
-|ExampleBlock |Yes |No |Yes |Yes |Yes |Yes |Yes
-|OpenBlock |Yes |No |Yes |Yes |Yes |Yes |Yes
-|=====================================================
-
-Listing Blocks
-~~~~~~~~~~~~~~
-'ListingBlocks' are rendered verbatim in a monospaced font, they
-retain line and whitespace formatting and are often distinguished by a
-background or border. There is no text formatting or substitutions
-within Listing blocks apart from Special Characters and Callouts.
-Listing blocks are often used for computer output and file listings.
-
-Here's an example:
-
-[listing]
-......................................
---------------------------------------
-#include
-
-int main() {
- printf("Hello World!\n");
- exit(0);
-}
---------------------------------------
-......................................
-
-Which will be rendered like:
-
---------------------------------------
-#include
-
-int main() {
- printf("Hello World!\n");
- exit(0);
-}
---------------------------------------
-
-By convention <> use the listing block syntax and
-are implemented as distinct listing block styles.
-
-[[X65]]
-Literal Blocks
-~~~~~~~~~~~~~~
-'LiteralBlocks' are rendered just like <>.
-Example:
-
----------------------------------------------------------------------
-...................................
-Consul *necessitatibus* per id,
-consetetur, eu pro everti postulant
-homero verear ea mea, qui.
-...................................
----------------------------------------------------------------------
-
-Renders:
-...................................
-Consul *necessitatibus* per id,
-consetetur, eu pro everti postulant
-homero verear ea mea, qui.
-...................................
-
-If the 'listing' style is applied to a LiteralBlock it will be
-rendered as a ListingBlock (this is handy if you have a listing
-containing a ListingBlock).
-
-Sidebar Blocks
-~~~~~~~~~~~~~~
-A sidebar is a short piece of text presented outside the narrative
-flow of the main text. The sidebar is normally presented inside a
-bordered box to set it apart from the main text.
-
-The sidebar body is treated like a normal section body.
-
-Here's an example:
-
----------------------------------------------------------------------
-.An Example Sidebar
-************************************************
-Any AsciiDoc SectionBody element (apart from
-SidebarBlocks) can be placed inside a sidebar.
-************************************************
----------------------------------------------------------------------
-
-Which will be rendered like:
-
-.An Example Sidebar
-************************************************
-Any AsciiDoc SectionBody element (apart from
-SidebarBlocks) can be placed inside a sidebar.
-************************************************
-
-[[X26]]
-Comment Blocks
-~~~~~~~~~~~~~~
-The contents of 'CommentBlocks' are not processed; they are useful for
-annotations and for excluding new or outdated content that you don't
-want displayed. CommentBlocks are never written to output files.
-Example:
-
----------------------------------------------------------------------
-//////////////////////////////////////////
-CommentBlock contents are not processed by
-asciidoc(1).
-//////////////////////////////////////////
----------------------------------------------------------------------
-
-See also <>.
-
-NOTE: System macros are executed inside comment blocks.
-
-[[X76]]
-Passthrough Blocks
-~~~~~~~~~~~~~~~~~~
-By default the block contents is subject only to 'attributes' and
-'macros' substitutions (use an explicit 'subs' attribute to apply
-different substitutions). PassthroughBlock content will often be
-backend specific. Here's an example:
-
----------------------------------------------------------------------
-[subs="quotes"]
-++++++++++++++++++++++++++++++++++++++
-
-
*Cell 1*
-
*Cell 2*
-
-++++++++++++++++++++++++++++++++++++++
----------------------------------------------------------------------
-
-The following styles can be applied to passthrough blocks:
-
-pass::
- No substitutions are performed. This is equivalent to `subs="none"`.
-
-asciimath, latexmath::
- By default no substitutions are performed, the contents are rendered
- as <>.
-
-Quote Blocks
-~~~~~~~~~~~~
-'QuoteBlocks' are used for quoted passages of text. There are two
-styles: 'quote' and 'verse'. The style behavior is identical to
-<> except that blocks can contain
-multiple paragraphs and, in the case of the 'quote' style, other
-section elements. The first positional attribute sets the style, if
-no attributes are specified the 'quote' style is used. The optional
-'attribution' and 'citetitle' attributes (positional attributes 2 and
-3) specify the quote's author and source. For example:
-
----------------------------------------------------------------------
-[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
-____________________________________________________________________
-As he spoke there was the sharp sound of horses' hoofs and
-grating wheels against the curb, followed by a sharp pull at the
-bell. Holmes whistled.
-
-"A pair, by the sound," said he. "Yes," he continued, glancing
-out of the window. "A nice little brougham and a pair of
-beauties. A hundred and fifty guineas apiece. There's money in
-this case, Watson, if there is nothing else."
-____________________________________________________________________
----------------------------------------------------------------------
-
-Which is rendered as:
-
-[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
-____________________________________________________________________
-As he spoke there was the sharp sound of horses' hoofs and
-grating wheels against the curb, followed by a sharp pull at the
-bell. Holmes whistled.
-
-"A pair, by the sound," said he. "Yes," he continued, glancing
-out of the window. "A nice little brougham and a pair of
-beauties. A hundred and fifty guineas apiece. There's money in
-this case, Watson, if there is nothing else."
-____________________________________________________________________
-
-[[X48]]
-Example Blocks
-~~~~~~~~~~~~~~
-'ExampleBlocks' encapsulate the DocBook Example element and are used
-for, well, examples. Example blocks can be titled by preceding them
-with a 'BlockTitle'. DocBook toolchains will normally automatically
-number examples and generate a 'List of Examples' backmatter section.
-
-Example blocks are delimited by lines of equals characters and can
-contain any block elements apart from Titles, BlockTitles and
-Sidebars) inside an example block. For example:
-
----------------------------------------------------------------------
-.An example
-=====================================================================
-Qui in magna commodo, est labitur dolorum an. Est ne magna primis
-adolescens.
-=====================================================================
----------------------------------------------------------------------
-
-Renders:
-
-.An example
-=====================================================================
-Qui in magna commodo, est labitur dolorum an. Est ne magna primis
-adolescens.
-=====================================================================
-
-A title prefix that can be inserted with the `caption` attribute
-(HTML backends). For example:
-
----------------------------------------------------------------------
-[caption="Example 1: "]
-.An example with a custom caption
-=====================================================================
-Qui in magna commodo, est labitur dolorum an. Est ne magna primis
-adolescens.
-=====================================================================
----------------------------------------------------------------------
-
-[[X22]]
-Admonition Blocks
-~~~~~~~~~~~~~~~~~
-The 'ExampleBlock' definition includes a set of admonition
-<> ('NOTE', 'TIP', 'IMPORTANT', 'WARNING', 'CAUTION') for
-generating admonition blocks (admonitions containing more than a
-<>). Just precede the 'ExampleBlock' with an
-attribute list specifying the admonition style name. For example:
-
----------------------------------------------------------------------
-[NOTE]
-.A NOTE admonition block
-=====================================================================
-Qui in magna commodo, est labitur dolorum an. Est ne magna primis
-adolescens.
-
-. Fusce euismod commodo velit.
-. Vivamus fringilla mi eu lacus.
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
-. Donec eget arcu bibendum
- nunc consequat lobortis.
-=====================================================================
----------------------------------------------------------------------
-
-Renders:
-
-[NOTE]
-.A NOTE admonition block
-=====================================================================
-Qui in magna commodo, est labitur dolorum an. Est ne magna primis
-adolescens.
-
-. Fusce euismod commodo velit.
-. Vivamus fringilla mi eu lacus.
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
-. Donec eget arcu bibendum
- nunc consequat lobortis.
-=====================================================================
-
-See also <>.
-
-[[X29]]
-Open Blocks
-~~~~~~~~~~~
-Open blocks are special:
-
-- The open block delimiter is line containing two hyphen characters
- (instead of four or more repeated characters).
-
-- They can be used to group block elements for <>.
-
-- Open blocks can be styled to behave like any other type of delimited
- block. The following built-in styles can be applied to open
- blocks: 'literal', 'verse', 'quote', 'listing', 'TIP', 'NOTE',
- 'IMPORTANT', 'WARNING', 'CAUTION', 'abstract', 'partintro',
- 'comment', 'example', 'sidebar', 'source', 'music', 'latex',
- 'graphviz'. For example, the following open block and listing block
- are functionally identical:
-
- [listing]
- --
- Lorum ipsum ...
- --
-
- ---------------
- Lorum ipsum ...
- ---------------
-
-- An unstyled open block groups section elements but otherwise does
- nothing.
-
-Open blocks are used to generate document abstracts and book part
-introductions:
-
-- Apply the 'abstract' style to generate an abstract, for example:
-
- [abstract]
- --
- In this paper we will ...
- --
-
-. Apply the 'partintro' style to generate a book part introduction for
- a multi-part book, for example:
-
- [partintro]
- .Optional part introduction title
- --
- Optional part introduction goes here.
- --
-
-
-[[X64]]
-Lists
------
-.List types
-- Bulleted lists. Also known as itemized or unordered lists.
-- Numbered lists. Also called ordered lists.
-- Labeled lists. Sometimes called variable or definition lists.
-- Callout lists (a list of callout annotations).
-
-.List behavior
-- List item indentation is optional and does not determine nesting,
- indentation does however make the source more readable.
-- Another list or a literal paragraph immediately following a list
- item will be implicitly included in the list item; use <> to explicitly append other block elements to a
- list item.
-- A comment block or a comment line block macro element will terminate
- a list -- use inline comment lines to put comments inside lists.
-- The `listindex` <> is the current list item
- index (1..). If this attribute is used outside a list then it's value
- is the number of items in the most recently closed list. Useful for
- displaying the number of items in a list.
-
-Bulleted Lists
-~~~~~~~~~~~~~~
-Bulleted list items start with a single dash or one to five asterisks
-followed by some white space then some text. Bulleted list syntaxes
-are:
-
-...................
-- List item.
-* List item.
-** List item.
-*** List item.
-**** List item.
-***** List item.
-...................
-
-Numbered Lists
-~~~~~~~~~~~~~~
-List item numbers are explicit or implicit.
-
-.Explicit numbering
-List items begin with a number followed by some white space then the
-item text. The numbers can be decimal (arabic), roman (upper or lower
-case) or alpha (upper or lower case). Decimal and alpha numbers are
-terminated with a period, roman numbers are terminated with a closing
-parenthesis. The different terminators are necessary to ensure 'i',
-'v' and 'x' roman numbers are are distinguishable from 'x', 'v' and
-'x' alpha numbers. Examples:
-
-.....................................................................
-1. Arabic (decimal) numbered list item.
-a. Lower case alpha (letter) numbered list item.
-F. Upper case alpha (letter) numbered list item.
-iii) Lower case roman numbered list item.
-IX) Upper case roman numbered list item.
-.....................................................................
-
-.Implicit numbering
-List items begin one to five period characters, followed by some white
-space then the item text. Examples:
-
-.....................................................................
-. Arabic (decimal) numbered list item.
-.. Lower case alpha (letter) numbered list item.
-... Lower case roman numbered list item.
-.... Upper case alpha (letter) numbered list item.
-..... Upper case roman numbered list item.
-.....................................................................
-
-You can use the 'style' attribute (also the first positional
-attribute) to specify an alternative numbering style. The numbered
-list style can be one of the following values: 'arabic', 'loweralpha',
-'upperalpha', 'lowerroman', 'upperroman'.
-
-Here are some examples of bulleted and numbered lists:
-
----------------------------------------------------------------------
-- Praesent eget purus quis magna eleifend eleifend.
- 1. Fusce euismod commodo velit.
- a. Fusce euismod commodo velit.
- b. Vivamus fringilla mi eu lacus.
- c. Donec eget arcu bibendum nunc consequat lobortis.
- 2. Vivamus fringilla mi eu lacus.
- i) Fusce euismod commodo velit.
- ii) Vivamus fringilla mi eu lacus.
- 3. Donec eget arcu bibendum nunc consequat lobortis.
- 4. Nam fermentum mattis ante.
-- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- * Fusce euismod commodo velit.
- ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
- adolescens. Sit munere ponderum dignissim et. Minim luptatum et
- vel.
- ** Vivamus fringilla mi eu lacus.
- * Donec eget arcu bibendum nunc consequat lobortis.
-- Nulla porttitor vulputate libero.
- . Fusce euismod commodo velit.
- . Vivamus fringilla mi eu lacus.
-[upperroman]
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
- . Donec eget arcu bibendum nunc consequat lobortis.
----------------------------------------------------------------------
-
-Which render as:
-
-- Praesent eget purus quis magna eleifend eleifend.
- 1. Fusce euismod commodo velit.
- a. Fusce euismod commodo velit.
- b. Vivamus fringilla mi eu lacus.
- c. Donec eget arcu bibendum nunc consequat lobortis.
- 2. Vivamus fringilla mi eu lacus.
- i) Fusce euismod commodo velit.
- ii) Vivamus fringilla mi eu lacus.
- 3. Donec eget arcu bibendum nunc consequat lobortis.
- 4. Nam fermentum mattis ante.
-- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
- * Fusce euismod commodo velit.
- ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
- adolescens. Sit munere ponderum dignissim et. Minim luptatum et
- vel.
- ** Vivamus fringilla mi eu lacus.
- * Donec eget arcu bibendum nunc consequat lobortis.
-- Nulla porttitor vulputate libero.
- . Fusce euismod commodo velit.
- . Vivamus fringilla mi eu lacus.
-[upperroman]
- .. Fusce euismod commodo velit.
- .. Vivamus fringilla mi eu lacus.
- . Donec eget arcu bibendum nunc consequat lobortis.
-
-A predefined 'compact' option is available to bulleted and numbered
-lists -- this translates to the DocBook 'spacing="compact"' lists
-attribute which may or may not be processed by the DocBook toolchain.
-Example:
-
- [options="compact"]
- - Compact list item.
- - Another compact list item.
-
-TIP: To apply the 'compact' option globally define a document-wide
-'compact-option' attribute, e.g. using the `-a compact-option`
-command-line option.
-
-You can set the list start number using the 'start' attribute (works
-for HTML outputs and DocBook outputs processed by DocBook XSL
-Stylesheets). Example:
-
- [start=7]
- . List item 7.
- . List item 8.
-
-Labeled Lists
-~~~~~~~~~~~~~
-Labeled list items consist of one or more text labels followed by the
-text of the list item.
-
-An item label begins a line with an alphanumeric character hard
-against the left margin and ends with two, three or four colons or two
-semi-colons. A list item can have multiple labels, one per line.
-
-The list item text consists of one or more lines of text starting
-after the last label (either on the same line or a new line) and can
-be followed by nested List or ListParagraph elements. Item text can be
-optionally indented.
-
-Here are some examples:
-
----------------------------------------------------------------------
-In::
-Lorem::
- Fusce euismod commodo velit.
-
- Fusce euismod commodo velit.
-
-Ipsum:: Vivamus fringilla mi eu lacus.
- * Vivamus fringilla mi eu lacus.
- * Donec eget arcu bibendum nunc consequat lobortis.
-Dolor::
- Donec eget arcu bibendum nunc consequat lobortis.
- Suspendisse;;
- A massa id sem aliquam auctor.
- Morbi;;
- Pretium nulla vel lorem.
- In;;
- Dictum mauris in urna.
- Vivamus::: Fringilla mi eu lacus.
- Donec::: Eget arcu bibendum nunc consequat lobortis.
----------------------------------------------------------------------
-
-Which render as:
-
-In::
-Lorem::
- Fusce euismod commodo velit.
-
- Fusce euismod commodo velit.
-
-Ipsum:: Vivamus fringilla mi eu lacus.
- * Vivamus fringilla mi eu lacus.
- * Donec eget arcu bibendum nunc consequat lobortis.
-Dolor::
- Donec eget arcu bibendum nunc consequat lobortis.
- Suspendisse;;
- A massa id sem aliquam auctor.
- Morbi;;
- Pretium nulla vel lorem.
- In;;
- Dictum mauris in urna.
- Vivamus::: Fringilla mi eu lacus.
- Donec::: Eget arcu bibendum nunc consequat lobortis.
-
-Horizontal labeled list style
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The 'horizontal' labeled list style (also the first positional
-attribute) places the list text side-by-side with the label instead of
-under the label. Here is an example:
-
----------------------------------------------------------------------
-[horizontal]
-*Lorem*:: Fusce euismod commodo velit. Qui in magna commodo, est
-labitur dolorum an. Est ne magna primis adolescens.
-
- Fusce euismod commodo velit.
-
-*Ipsum*:: Vivamus fringilla mi eu lacus.
-- Vivamus fringilla mi eu lacus.
-- Donec eget arcu bibendum nunc consequat lobortis.
-
-*Dolor*::
- - Vivamus fringilla mi eu lacus.
- - Donec eget arcu bibendum nunc consequat lobortis.
-
----------------------------------------------------------------------
-
-Which render as:
-
-[horizontal]
-*Lorem*:: Fusce euismod commodo velit. Qui in magna commodo, est
-labitur dolorum an. Est ne magna primis adolescens.
-
- Fusce euismod commodo velit.
-
-*Ipsum*:: Vivamus fringilla mi eu lacus.
-- Vivamus fringilla mi eu lacus.
-- Donec eget arcu bibendum nunc consequat lobortis.
-
-*Dolor*::
- - Vivamus fringilla mi eu lacus.
- - Donec eget arcu bibendum nunc consequat lobortis.
-
-[NOTE]
-=====================================================================
-- Current PDF toolchains do not make a good job of determining
- the relative column widths for horizontal labeled lists.
-- Nested horizontal labeled lists will generate DocBook validation
- errors because the 'DocBook XML V4.2' DTD does not permit nested
- informal tables (although <> and
- <> process them correctly).
-- The label width can be set as a percentage of the total width by
- setting the 'width' attribute e.g. `width="10%"`
-=====================================================================
-
-Question and Answer Lists
-~~~~~~~~~~~~~~~~~~~~~~~~~
-AsciiDoc comes pre-configured with a 'qanda' style labeled list for generating
-DocBook question and answer (Q&A) lists. Example:
-
----------------------------------------------------------------------
-[qanda]
-Question one::
- Answer one.
-Question two::
- Answer two.
----------------------------------------------------------------------
-
-Renders:
-
-[qanda]
-Question one::
- Answer one.
-Question two::
- Answer two.
-
-Glossary Lists
-~~~~~~~~~~~~~~
-AsciiDoc comes pre-configured with a 'glossary' style labeled list for
-generating DocBook glossary lists. Example:
-
----------------------------------------------------------------------
-[glossary]
-A glossary term::
- The corresponding definition.
-A second glossary term::
- The corresponding definition.
----------------------------------------------------------------------
-
-For working examples see the `article.txt` and `book.txt` documents in
-the AsciiDoc `./doc` distribution directory.
-
-NOTE: To generate valid DocBook output glossary lists must be located
-in a section that uses the 'glossary' <>.
-
-Bibliography Lists
-~~~~~~~~~~~~~~~~~~
-AsciiDoc comes with a predefined 'bibliography' bulleted list style
-generating DocBook bibliography entries. Example:
-
----------------------------------------------------------------------
-[bibliography]
-.Optional list title
-- [[[taoup]]] Eric Steven Raymond. 'The Art of UNIX
- Programming'. Addison-Wesley. ISBN 0-13-142901-9.
-- [[[walsh-muellner]]] Norman Walsh & Leonard Muellner.
- 'DocBook - The Definitive Guide'. O'Reilly & Associates.
- 1999. ISBN 1-56592-580-7.
----------------------------------------------------------------------
-
-The `[[[]]]` syntax is a bibliography entry anchor, it
-generates an anchor named `` and additionally displays
-`[]` at the anchor position. For example `[[[taoup]]]`
-generates an anchor named `taoup` that displays `[taoup]` at the
-anchor position. Cite the reference from elsewhere your document using
-`<>`, this displays a hyperlink (`[taoup]`) to the
-corresponding bibliography entry anchor.
-
-For working examples see the `article.txt` and `book.txt` documents in
-the AsciiDoc `./doc` distribution directory.
-
-NOTE: To generate valid DocBook output bibliography lists must be
-located in a <>.
-
-[[X15]]
-List Item Continuation
-~~~~~~~~~~~~~~~~~~~~~~
-Another list or a literal paragraph immediately following a list item
-is implicitly appended to the list item; to append other block
-elements to a list item you need to explicitly join them to the list
-item with a 'list continuation' (a separator line containing a single
-plus character). Multiple block elements can be appended to a list
-item using list continuations (provided they are legal list item
-children in the backend markup).
-
-Here are some examples of list item continuations: list item one
-contains multiple continuations; list item two is continued with an
-<> containing multiple elements:
-
----------------------------------------------------------------------
-1. List item one.
-+
-List item one continued with a second paragraph followed by an
-Indented block.
-+
-.................
-$ ls *.sh
-$ mv *.sh ~/tmp
-.................
-+
-List item continued with a third paragraph.
-
-2. List item two continued with an open block.
-+
---
-This paragraph is part of the preceding list item.
-
-a. This list is nested and does not require explicit item continuation.
-+
-This paragraph is part of the preceding list item.
-
-b. List item b.
-
-This paragraph belongs to item two of the outer list.
---
----------------------------------------------------------------------
-
-Renders:
-
-1. List item one.
-+
-List item one continued with a second paragraph followed by an
-Indented block.
-+
-.................
-$ ls *.sh
-$ mv *.sh ~/tmp
-.................
-+
-List item continued with a third paragraph.
-
-2. List item two continued with an open block.
-+
---
-This paragraph is part of the preceding list item.
-
-a. This list is nested and does not require explicit item continuation.
-+
-This paragraph is part of the preceding list item.
-
-b. List item b.
-
-This paragraph belongs to item two of the outer list.
---
-
-
-[[X92]]
-Footnotes
----------
-The shipped AsciiDoc configuration includes three footnote inline
-macros:
-
-`footnote:[]`::
- Generates a footnote with text ``.
-
-`footnoteref:[,]`::
- Generates a footnote with a reference ID `` and text ``.
-
-`footnoteref:[]`::
- Generates a reference to the footnote with ID ``.
-
-The footnote text can span multiple lines.
-
-The 'xhtml11' and 'html5' backends render footnotes dynamically using
-JavaScript; 'html4' outputs do not use JavaScript and leave the
-footnotes inline; 'docbook' footnotes are processed by the downstream
-DocBook toolchain.
-
-Example footnotes:
-
- A footnote footnote:[An example footnote.];
- a second footnote with a reference ID footnoteref:[note2,Second footnote.];
- finally a reference to the second footnote footnoteref:[note2].
-
-Renders:
-
-A footnote footnote:[An example footnote.];
-a second footnote with a reference ID footnoteref:[note2,Second footnote.];
-finally a reference to the second footnote footnoteref:[note2].
-
-
-Indexes
--------
-The shipped AsciiDoc configuration includes the inline macros for
-generating DocBook index entries.
-
-`indexterm:[,,]`::
-`(((,,)))`::
- This inline macro generates an index term (the `` and
- `` positional attributes are optional). Example:
- `indexterm:[Tigers,Big cats]` (or, using the alternative syntax
- `(((Tigers,Big cats)))`. Index terms that have secondary and
- tertiary entries also generate separate index terms for the
- secondary and tertiary entries. The index terms appear in the
- index, not the primary text flow.
-
-`indexterm2:[]`::
-`(())`::
- This inline macro generates an index term that appears in both the
- index and the primary text flow. The `` should not be
- padded to the left or right with white space characters.
-
-For working examples see the `article.txt` and `book.txt` documents in
-the AsciiDoc `./doc` distribution directory.
-
-NOTE: Index entries only really make sense if you are generating
-DocBook markup -- DocBook conversion programs automatically generate
-an index at the point an 'Index' section appears in source document.
-
-
-[[X105]]
-Callouts
---------
-Callouts are a mechanism for annotating verbatim text (for example:
-source code, computer output and user input). Callout markers are
-placed inside the annotated text while the actual annotations are
-presented in a callout list after the annotated text. Here's an
-example:
-
----------------------------------------------------------------------
- .MS-DOS directory listing
- -----------------------------------------------------
- 10/17/97 9:04 bin
- 10/16/97 14:11 DOS \<1>
- 10/16/97 14:40 Program Files
- 10/16/97 14:46 TEMP
- 10/17/97 9:04 tmp
- 10/16/97 14:37 WINNT
- 10/16/97 14:25 119 AUTOEXEC.BAT \<2>
- 2/13/94 6:21 54,619 COMMAND.COM \<2>
- 10/16/97 14:25 115 CONFIG.SYS \<2>
- 11/16/97 17:17 61,865,984 pagefile.sys
- 2/13/94 6:21 9,349 WINA20.386 \<3>
- -----------------------------------------------------
-
- \<1> This directory holds MS-DOS.
- \<2> System startup code for DOS.
- \<3> Some sort of Windows 3.1 hack.
----------------------------------------------------------------------
-
-Which renders:
-
-.MS-DOS directory listing
------------------------------------------------------
-10/17/97 9:04 bin
-10/16/97 14:11 DOS <1>
-10/16/97 14:40 Program Files
-10/16/97 14:46 TEMP
-10/17/97 9:04 tmp
-10/16/97 14:37 WINNT
-10/16/97 14:25 119 AUTOEXEC.BAT <2>
- 2/13/94 6:21 54,619 COMMAND.COM <2>
-10/16/97 14:25 115 CONFIG.SYS <2>
-11/16/97 17:17 61,865,984 pagefile.sys
- 2/13/94 6:21 9,349 WINA20.386 <3>
------------------------------------------------------
-
-<1> This directory holds MS-DOS.
-<2> System startup code for DOS.
-<3> Some sort of Windows 3.1 hack.
-
-.Explanation
-- The callout marks are whole numbers enclosed in angle brackets --
- they refer to the correspondingly numbered item in the following
- callout list.
-- By default callout marks are confined to 'LiteralParagraphs',
- 'LiteralBlocks' and 'ListingBlocks' (although this is a
- configuration file option and can be changed).
-- Callout list item numbering is fairly relaxed -- list items can
- start with ``, `n>` or `>` where `n` is the optional list item
- number (in the latter case list items starting with a single `>`
- character are implicitly numbered starting at one).
-- Callout lists should not be nested.
-- Callout lists start list items hard against the left margin.
-- If you want to present a number inside angle brackets you'll need to
- escape it with a backslash to prevent it being interpreted as a
- callout mark.
-
-NOTE: Define the AsciiDoc 'icons' attribute (for example using the `-a
-icons` command-line option) to display callout icons.
-
-Implementation Notes
-~~~~~~~~~~~~~~~~~~~~
-Callout marks are generated by the 'callout' inline macro while
-callout lists are generated using the 'callout' list definition. The
-'callout' macro and 'callout' list are special in that they work
-together. The 'callout' inline macro is not enabled by the normal
-'macros' substitutions option, instead it has its own 'callouts'
-substitution option.
-
-The following attributes are available during inline callout macro
-substitution:
-
-`{index}`::
- The callout list item index inside the angle brackets.
-`{coid}`::
- An identifier formatted like `CO-` that
- uniquely identifies the callout mark. For example `CO2-4`
- identifies the fourth callout mark in the second set of callout
- marks.
-
-The `{coids}` attribute can be used during callout list item
-substitution -- it is a space delimited list of callout IDs that refer
-to the explanatory list item.
-
-Including callouts in included code
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-You can annotate working code examples with callouts -- just remember
-to put the callouts inside source code comments. This example displays
-the `test.py` source file (containing a single callout) using the
-'source' (code highlighter) filter:
-
-.AsciiDoc source
----------------------------------------------------------------------
- [source,python]
- -------------------------------------------
- \include::test.py[]
- -------------------------------------------
-
- \<1> Print statement.
----------------------------------------------------------------------
-
-.Included `test.py` source
----------------------------------------------------------------------
-print 'Hello World!' # \<1>
----------------------------------------------------------------------
-
-
-Macros
-------
-Macros are a mechanism for substituting parametrized text into output
-documents.
-
-Macros have a 'name', a single 'target' argument and an 'attribute
-list'. The usual syntax is `:[]` (for
-inline macros) and `::[]` (for block
-macros). Here are some examples:
-
- http://www.docbook.org/[DocBook.org]
- include::chapt1.txt[tabsize=2]
- mailto:srackham@gmail.com[]
-
-.Macro behavior
-- `` is the macro name. It can only contain letters, digits or
- dash characters and cannot start with a dash.
-- The optional `` cannot contain white space characters.
-- `` is a <> enclosed in square
- brackets.
-- `]` characters inside attribute lists must be escaped with a
- backslash.
-- Expansion of macro references can normally be escaped by prefixing a
- backslash character (see the AsciiDoc 'FAQ' for examples of
- exceptions to this rule).
-- Attribute references in block macros are expanded.
-- The substitutions performed prior to Inline macro macro expansion
- are determined by the inline context.
-- Macros are processed in the order they appear in the configuration
- file(s).
-- Calls to inline macros can be nested inside different inline macros
- (an inline macro call cannot contain a nested call to itself).
-- In addition to ``, `` and `` the
- `` and `` named groups are available to
- <>. A macro is a passthrough macro if the
- definition includes a `` named group.
-
-Inline Macros
-~~~~~~~~~~~~~
-Inline Macros occur in an inline element context. Predefined Inline
-macros include 'URLs', 'image' and 'link' macros.
-
-URLs
-^^^^
-'http', 'https', 'ftp', 'file', 'mailto' and 'callto' URLs are
-rendered using predefined inline macros.
-
-- If you don't need a custom link caption you can enter the 'http',
- 'https', 'ftp', 'file' URLs and email addresses without any special
- macro syntax.
-- If the `` is empty the URL is displayed.
-
-Here are some examples:
-
- http://www.docbook.org/[DocBook.org]
- http://www.docbook.org/
- mailto:joe.bloggs@foobar.com[email Joe Bloggs]
- joe.bloggs@foobar.com
-
-Which are rendered:
-
-http://www.docbook.org/[DocBook.org]
-
-http://www.docbook.org/
-
-mailto:joe.bloggs@foobar.com[email Joe Bloggs]
-
-joe.bloggs@foobar.com
-
-If the `` necessitates space characters use `%20`, for example
-`large%20image.png`.
-
-Internal Cross References
-^^^^^^^^^^^^^^^^^^^^^^^^^
-Two AsciiDoc inline macros are provided for creating hypertext links
-within an AsciiDoc document. You can use either the standard macro
-syntax or the (preferred) alternative.
-
-[[X30]]
-anchor
-++++++
-Used to specify hypertext link targets:
-
- [[,]]
- anchor:[]
-
-The `` is a unique string that conforms to the output markup's
-anchor syntax. The optional `` is the text to be displayed
-by captionless 'xref' macros that refer to this anchor. The optional
-`` is only really useful when generating DocBook output.
-Example anchor:
-
- [[X1]]
-
-You may have noticed that the syntax of this inline element is the
-same as that of the <>, this is no
-coincidence since they are functionally equivalent.
-
-xref
-++++
-Creates a hypertext link to a document anchor.
-
- <<,
>>
- xref:[
]
-
-The `` refers to an anchor ID. The optional `
` is the
-link's displayed text. Example:
-
- <>
-
-If `
` is not specified then the displayed text is
-auto-generated:
-
-- The AsciiDoc 'xhtml11' and 'html5' backends display the ``
- enclosed in square brackets.
-- If DocBook is produced the DocBook toolchain is responsible for the
- displayed text which will normally be the referenced figure, table
- or section title number followed by the element's title text.
-
-Here is an example:
-
----------------------------------------------------------------------
-[[tiger_image]]
-.Tyger tyger
-image::tiger.png[]
-
-This can be seen in <>.
----------------------------------------------------------------------
-
-Linking to Local Documents
-^^^^^^^^^^^^^^^^^^^^^^^^^^
-Hypertext links to files on the local file system are specified using
-the 'link' inline macro.
-
- link:[