Skip to content

Commit

Permalink
Clean up documentation for addons, mention lint addon
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Feb 21, 2013
1 parent 9e5599d commit 69fa5fd
Showing 1 changed file with 30 additions and 33 deletions.
63 changes: 30 additions & 33 deletions doc/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -1357,14 +1357,14 @@ <h2 id="addons">Add-ons</h2>
functionality. In brief, they are:</p>

<dl>
<dt id="addon_dialog"><a href="../addon/dialog/dialog.js"><code>dialog.js</code></a></dt>
<dt id="addon_dialog"><a href="../addon/dialog/dialog.js"><code>dialog/dialog.js</code></a></dt>
<dd>Provides a very simple way to query users for text input.
Adds an <code>openDialog</code> method to CodeMirror instances,
which can be called with an HTML fragment that provides the
prompt (should include an <code>input</code> tag), and a
callback function that is called when text has been entered.
Depends on <code>addon/dialog/dialog.css</code>.</dd>
<dt id="addon_searchcursor"><a href="../addon/search/searchcursor.js"><code>searchcursor.js</code></a></dt>
<dt id="addon_searchcursor"><a href="../addon/search/searchcursor.js"><code>search/searchcursor.js</code></a></dt>
<dd>Adds the <code>getSearchCursor(query, start, caseFold) →
cursor</code> method to CodeMirror instances, which can be used
to implement search/replace functionality. <code>query</code>
Expand Down Expand Up @@ -1393,29 +1393,29 @@ <h2 id="addons">Add-ons</h2>
replacement.</dd>
</dl></dd>

<dt id="addon_search"><a href="../addon/search/search.js"><code>search.js</code></a></dt>
<dt id="addon_search"><a href="../addon/search/search.js"><code>search/search.js</code></a></dt>
<dd>Implements the search commands. CodeMirror has keys bound to
these by default, but will not do anything with them unless an
implementation is provided. Depends
on <code>searchcursor.js</code>, and will make use
of <a href="#addon_dialog"><code>openDialog</code></a> when
available to make prompting for search queries less ugly.</dd>
<dt id="addon_matchbrackets"><a href="../addon/edit/matchbrackets.js"><code>matchbrackets.js</code></a></dt>
<dt id="addon_matchbrackets"><a href="../addon/edit/matchbrackets.js"><code>edit/matchbrackets.js</code></a></dt>
<dd>Defines an option <code>matchBrackets</code> which, when set
to true, causes matching brackets to be highlighted whenever the
cursor is next to them. It also adds a
method <code>matchBrackets</code> that forces this to happen
once, and a method <code>findMatchingBracket</code> that can be
used to run the bracket-finding algorithm that this uses
internally.</dd>
<dt id="addon_closebrackets"><a href="../addon/edit/closebrackets.js"><code>closebrackets.js</code></a></dt>
<dt id="addon_closebrackets"><a href="../addon/edit/closebrackets.js"><code>edit/closebrackets.js</code></a></dt>
<dd>Defines an option <code>autoCloseBrackets</code> that will
auto-close brackets and quotes when typed. By default, it'll
auto-close <code>()[]{}''""</code>, but you can pass it a
string similar to that (containing pairs of matching characters)
to customize it. <a href="../demo/closebrackets.html">Demo
here</a>.</dd>
<dt id="addon_foldcode"><a href="../addon/fold/foldcode.js"><code>foldcode.js</code></a></dt>
<dt id="addon_foldcode"><a href="../addon/fold/foldcode.js"><code>fold/foldcode.js</code></a></dt>
<dd>Helps with code folding.
See <a href="../demo/folding.html">the demo</a> for an example.
Call <code>CodeMirror.newFoldFunction</code> with a range-finder
Expand All @@ -1431,12 +1431,12 @@ <h2 id="addons">Add-ons</h2>
where indentation determines block structure (Python, Haskell),
and <code>CodeMirror.tagRangeFinder</code>, for XML-style
languages.</dd>
<dt id="addon_collapserange"><a href="../addon/fold/collapserange.js"><code>collapserange.js</code></a></dt>
<dt id="addon_collapserange"><a href="../addon/fold/collapserange.js"><code>fold/collapserange.js</code></a></dt>
<dd>Another approach to
folding. <a href="../demo/collapserange.html">See demo</a>.
Allows the user to select a range to fold by clicking in the
gutter.</dd>
<dt id="addon_runmode"><a href="../addon/runmode/runmode.js"><code>runmode.js</code></a></dt>
<dt id="addon_runmode"><a href="../addon/runmode/runmode.js"><code>runmode/runmode.js</code></a></dt>
<dd>Can be used to run a CodeMirror mode over text without
actually opening an editor instance.
See <a href="../demo/runmode.html">the demo</a> for an example.
Expand All @@ -1445,15 +1445,15 @@ <h2 id="addons">Add-ons</h2>
(without including all of CodeMirror) and
for <a href="../addon/runmode/runmode.node.js">running under
node.js</a>.</dd>
<dt id="addon_overlay"><a href="../addon/mode/overlay.js"><code>overlay.js</code></a></dt>
<dt id="addon_overlay"><a href="../addon/mode/overlay.js"><code>mode/overlay.js</code></a></dt>
<dd>Mode combinator that can be used to extend a mode with an
'overlay' — a secondary mode is run over the stream, along with
the base mode, and can color specific pieces of text without
interfering with the base mode.
Defines <code>CodeMirror.overlayMode</code>, which is used to
create such a mode. See <a href="../demo/mustache.html">this
demo</a> for a detailed example.</dd>
<dt id="addon_multiplex"><a href="../addon/mode/multiplex.js"><code>multiplex.js</code></a></dt>
<dt id="addon_multiplex"><a href="../addon/mode/multiplex.js"><code>mode/multiplex.js</code></a></dt>
<dd>Mode combinator that can be used to easily 'multiplex'
between several modes.
Defines <code>CodeMirror.multiplexingMode</code> which, when
Expand All @@ -1472,7 +1472,7 @@ <h2 id="addons">Add-ons</h2>
see the content between the delimiters.
See <a href="../demo/multiplex.html">this demo</a> for an
example.</dd>
<dt id="addon_show-hint"><a href="../addon/hint/show-hint.js"><code>show-hint.js</code></a></dt>
<dt id="addon_show-hint"><a href="../addon/hint/show-hint.js"><code>hint/show-hint.js</code></a></dt>
<dd>Provides a framework for showing autocompletion hints.
Defines <code>CodeMirror.showHint</code>, which takes a
CodeMirror instance and a hinting function, and pops up a widget
Expand All @@ -1482,44 +1482,41 @@ <h2 id="addons">Add-ons</h2>
is an array of strings (the completions), and <code>from</code>
and <code>to</code> give the start and end of the token that is
being completed. Depends
on <code>addon/hint/show-hint.css</code>.
See <a href="../demo/complete.html">the demo</a> for an
on <code>addon/hint/show-hint.css</code>. See the other files in
the <a href="../addon/hint/"><code>addon/hint</code></a> for
hint sources for various languages. Check
out <a href="../demo/complete.html">the demo</a> for an
example.</dd>
<dt id="addon_simple-hint"><a href="../addon/hint/simple-hint.js"><code>simple-hint.js</code></a></dt>
<dd>Defines <code>CodeMirror.simpleHint</code>, which is
compatible with <code>showHint</code>. Deprecated,
use <code>showHint</code> instead. Depends
on <code>addon/hint/simple-hint.css</code>.</dd>
<dt id="addon_javascript-hint"><a href="../addon/hint/javascript-hint.js"><code>javascript-hint.js</code></a></dt>
<dd>Defines <code>CodeMirror.javascriptHint</code>
and <code>CodeMirror.coffeescriptHint</code>, which are simple
hinting functions for the JavaScript and CoffeeScript
modes.</dd>
<dt id="addon_xml-hint"><a href="../addon/hint/xml-hint.js"><code>xml-hint.js</code></a></dt>
<dd>Defines <code>CodeMirror.xmlHint</code>, a hinting function
for XML (which requires a schema to be defined).</dd>
<dt id="addon_python-hint"><a href="../addon/hint/python-hint.js"><code>python-hint.js</code></a></dt>
<dd>Defines <code>CodeMirror.pythonHint</code>, a hinter for Python code.</dd>
<dt id="addon_match-highlighter"><a href="../addon/search/match-highlighter.js"><code>match-highlighter.js</code></a></dt>
<dd>Adds a <code>highlightSelectionMatches</code> option that
can be enabled to highlight all instances of a currently
selected word.
Demo <a href="../demo/matchhighlighter.html">here</a>.</dd>
<dt id="addon_mark-selection"><a href="../addon/selection/mark-selection.js"><code>mark-selection.js</code></a></dt>
<dt id="addon_lint"><a href="../addon/lint/lint.js"><code>lint/lint.js</code></a></dt>
<dd>Defines an interface component for showing linting warnings,
with pluggable warning sources
(see <a href="../addon/lint/json-lint.js"><code>json-lint.js</code></a>
and <a href="../addon/lint/javascript-lint.js"><code>javascript-lint.js</code></a>
in the same directory). Defines a <code>lintWith</code> option
that can be set to a warning source (for
example <code>CodeMirror.javascriptValidator</code>). Depends
on <code>addon/lint/lint.css</code>. A demo can be
found <a href="../demo/lint.html">here</a>.</dd>
<dt id="addon_mark-selection"><a href="../addon/selection/mark-selection.js"><code>selection/mark-selection.js</code></a></dt>
<dd>Causes the selected text to be marked with the CSS class
<code>CodeMirror-selectedtext</code> when the <code>styleSelectedText</code> option
is enabled. Useful to change the colour of the selection (in addition to the background),
like in <a href="../demo/markselection.html">this demo</a>.</dd>
<dt id="addon_active-line"><a href="../addon/selection/active-line.js"><code>active-line.js</code></a></dt>
<dt id="addon_active-line"><a href="../addon/selection/active-line.js"><code>selection/active-line.js</code></a></dt>
<dd>Defines a <code>styleActiveLine</code> option that, when enabled,
gives the wrapper of the active line the class <code>CodeMirror-activeline</code>,
and adds a background with the class <code>CodeMirror-activeline-background</code>.
is enabled. See the <a href="../demo/activeline.html">demo</a>.</dd>
<dt id="addon_closetag"><a href="../addon/edit/closetag.js"><code>closetag.js</code></a></dt>
<dt id="addon_closetag"><a href="../addon/edit/closetag.js"><code>edit/closetag.js</code></a></dt>
<dd>Provides utility functions for adding automatic tag closing
to XML modes. See
the <a href="../demo/closetag.html">demo</a>.</dd>
<dt id="addon_loadmode"><a href="../addon/mode/loadmode.js"><code>loadmode.js</code></a></dt>
<dt id="addon_loadmode"><a href="../addon/mode/loadmode.js"><code>mode/loadmode.js</code></a></dt>
<dd>Defines a <code>CodeMirror.requireMode(modename,
callback)</code> function that will try to load a given mode and
call the callback when it succeeded. You'll have to
Expand All @@ -1531,7 +1528,7 @@ <h2 id="addons">Add-ons</h2>
which will ensure the given mode is loaded and cause the given
editor instance to refresh its mode when the loading
succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd>
<dt id="addon_continuecomment"><a href="../addon/edit/continuecomment.js"><code>continuecomment.js</code></a></dt>
<dt id="addon_continuecomment"><a href="../addon/edit/continuecomment.js"><code>edit/continuecomment.js</code></a></dt>
<dd>Adds a <a href="#commands">command</a>
called <code>newlineAndIndentContinueComment</code> that you can
bind <code>Enter</code> to in order to have the editor prefix
Expand Down

0 comments on commit 69fa5fd

Please sign in to comment.