Skip to content

Commit 51a45cc

Browse files
committed
Document a few more addons
Issue #1894
1 parent 5ccebee commit 51a45cc

File tree

1 file changed

+52
-9
lines changed

1 file changed

+52
-9
lines changed

doc/manual.html

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ <h2>Configuration</h2>
359359
which causes the cursor to not reach all the way to the bottom
360360
of the line, looks better</dd>
361361

362-
<dt id="option_resetSelectionOnContextMenu"><code><strong>resetSelectionOnContextMenu</strong>: boolean</dt>
362+
<dt id="option_resetSelectionOnContextMenu"><code><strong>resetSelectionOnContextMenu</strong>: boolean</code></dt>
363363
<dd>Controls whether, when the context menu is opened with a
364364
click outside of the current selection, the cursor is moved to
365365
the point of the click. Defaults to <code>true</code>.</dd>
@@ -1788,6 +1788,19 @@ <h2>Addons</h2>
17881788
The <a href="../demo/trailingspace.html">demo</a> has a nice
17891789
squiggly underline style for this class.</dd>
17901790

1791+
<dt id="addon_closetag"><a href="../addon/edit/closetag.js"><code>edit/closetag.js</code></a></dt>
1792+
<dd>Provides utility functions for adding automatic tag closing
1793+
to XML modes. See
1794+
the <a href="../demo/closetag.html">demo</a>.</dd>
1795+
1796+
<dt id="addon_continuelist"><a href="../addon/edit/continuelist.js"><code>edit/continuelist.js</code></a></dt>
1797+
<dd>Markdown specific. Defines
1798+
a <code>"newlineAndIndentContinueMarkdownList"</code> <a href="#commands">command</a>
1799+
command that can be bound to <code>enter</code> to automatically
1800+
insert the leading characters for continuing a list. See
1801+
the <a href="../mode/markdown/index.html">Markdown mode
1802+
demo</a>.</dd>
1803+
17911804
<dt id="addon_comment"><a href="../addon/comment/comment.js"><code>comment/comment.js</code></a></dt>
17921805
<dd>Addon for commenting and uncommenting code. Adds three
17931806
methods to CodeMirror instances:
@@ -1920,6 +1933,22 @@ <h2>Addons</h2>
19201933
for <a href="../addon/runmode/runmode.node.js">running under
19211934
node.js</a>.</dd>
19221935

1936+
<dt id="addon_colorize"><a href="../addon/runmode/colorize.js"><code>runmode/colorize.js</code></a></dt>
1937+
<dd>Provides a convenient way to syntax-highlight code snippets
1938+
in a webpage. Depends on
1939+
the <a href="#addon_runmode"><code>runmode</code></a> addon (or
1940+
its standalone variant). Provides
1941+
a <code>CodeMirror.colorize</code> function that can be called
1942+
with an array (or other array-ish collection) of DOM nodes that
1943+
represent the code snippets. By default, it'll get
1944+
all <code>pre</code> tags. Will read the <code>data-lang</code>
1945+
attribute of these nodes to figure out their language, and
1946+
syntax-color their content using the relevant CodeMirror mode
1947+
(you'll have to load the scripts for the relevant modes
1948+
yourself). A second argument may be provided to give a default
1949+
mode, used when no language attribute is found for a node. Used
1950+
in this manual to highlight example code.</dd>
1951+
19231952
<dt id="addon_overlay"><a href="../addon/mode/overlay.js"><code>mode/overlay.js</code></a></dt>
19241953
<dd>Mode combinator that can be used to extend a mode with an
19251954
'overlay' — a secondary mode is run over the stream, along with
@@ -2086,7 +2115,13 @@ <h2>Addons</h2>
20862115
and <code>range</code>, which defines how many lines the addon
20872116
should scan when completing (defaults to 500).</dd>
20882117

2089-
<dt id="addon_match-highlighter"><a href="../addon/search/match-highlighter.js"><code>match-highlighter.js</code></a></dt>
2118+
<dt id="addon_sql_hint"><a href="../addon/hint/sql-hint.js"><code>hint/sql-hint.js</code></a></dt>
2119+
<dd>A simple SQL hinter. Defines <code>CodeMirror.hint.sql</code>.</dd>
2120+
2121+
<dt id="addon_pig_hint"><a href="../addon/hint/pig-hint.js"><code>hint/pig-hint.js</code></a></dt>
2122+
<dd>A simple hinter for <a href="../mode/pig/index.html">Pig Latin</a>. Defines <code>CodeMirror.hint.pig</code>.</dd>
2123+
2124+
<dt id="addon_match-highlighter"><a href="../addon/search/match-highlighter.js"><code>search/match-highlighter.js</code></a></dt>
20902125
<dd>Adds a <code>highlightSelectionMatches</code> option that
20912126
can be enabled to highlight all instances of a currently
20922127
selected word. Can be set either to true or to an object
@@ -2105,8 +2140,9 @@ <h2>Addons</h2>
21052140
<dt id="addon_lint"><a href="../addon/lint/lint.js"><code>lint/lint.js</code></a></dt>
21062141
<dd>Defines an interface component for showing linting warnings,
21072142
with pluggable warning sources
2108-
(see <a href="../addon/lint/json-lint.js"><code>json-lint.js</code></a>
2109-
and <a href="../addon/lint/javascript-lint.js"><code>javascript-lint.js</code></a>
2143+
(see <a href="../addon/lint/json-lint.js"><code>json-lint.js</code></a>,
2144+
<a href="../addon/lint/javascript-lint.js"><code>javascript-lint.js</code></a>,
2145+
and <a href="../addon/lint/css-lint.js"><code>css-lint.js</code></a>
21102146
in the same directory). Defines a <code>lint</code> option that
21112147
can be set to a warning source (for
21122148
example <code>CodeMirror.lint.javascript</code>), or
@@ -2128,11 +2164,6 @@ <h2>Addons</h2>
21282164
and adds a background with the class <code>CodeMirror-activeline-background</code>.
21292165
is enabled. See the <a href="../demo/activeline.html">demo</a>.</dd>
21302166

2131-
<dt id="addon_closetag"><a href="../addon/edit/closetag.js"><code>edit/closetag.js</code></a></dt>
2132-
<dd>Provides utility functions for adding automatic tag closing
2133-
to XML modes. See
2134-
the <a href="../demo/closetag.html">demo</a>.</dd>
2135-
21362167
<dt id="addon_loadmode"><a href="../addon/mode/loadmode.js"><code>mode/loadmode.js</code></a></dt>
21372168
<dd>Defines a <code>CodeMirror.requireMode(modename,
21382169
callback)</code> function that will try to load a given mode and
@@ -2213,6 +2244,18 @@ <h2>Addons</h2>
22132244
editor in non-editable CodeMirror instances. The merge interface
22142245
will highlight changes between the editable document and the
22152246
original(s) (<a href="../demo/merge.html">demo</a>).</dd>
2247+
2248+
<dt id="addon_tern"><a href="../addon/tern/tern.js"><code>tern/tern.js</code></a></dt>
2249+
<dd>Provides integration with
2250+
the <a href="http://ternjs.net">Tern</a> JavaScript analysis
2251+
engine, for completion, definition finding, and minor
2252+
refactoring help. See the <a href="../demo/tern.html">demo</a>
2253+
for a very simple integration. For more involved scenarios, see
2254+
the comments at the top of
2255+
the <a href="../addon/tern/tern.js">addon</a> and the
2256+
implementation of the
2257+
(multi-file) <a href="http://ternjs.net/doc/demo.html">demonstration
2258+
on the Tern website</a>.</dd>
22162259
</dl>
22172260
</section>
22182261

0 commit comments

Comments
 (0)