X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=third-party%2Fcodemirror-3.15%2Fdemo%2Frunmode.html;fp=third-party%2Fcodemirror-3.15%2Fdemo%2Frunmode.html;h=dba808ba7a66cefedac922d5804d56c89c40e4e2;hb=75d3bceb8e1d168e83982f910a916aee3bab7981;hp=0000000000000000000000000000000000000000;hpb=302dd5bda1297ed6579ca26da35ee67f8d35d934;p=unfold.git diff --git a/third-party/codemirror-3.15/demo/runmode.html b/third-party/codemirror-3.15/demo/runmode.html new file mode 100644 index 00000000..dba808ba --- /dev/null +++ b/third-party/codemirror-3.15/demo/runmode.html @@ -0,0 +1,50 @@ + + + + + CodeMirror: Mode Runner Demo + + + + + + + +

CodeMirror: Mode Runner Demo

+ +
+ +

+
+    
+
+    

Running a CodeMirror mode outside of the editor. + The CodeMirror.runMode function, defined + in lib/runmode.js takes the following arguments:

+ +
+
text (string)
+
The document to run through the highlighter.
+
mode (mode spec)
+
The mode to use (must be loaded as normal).
+
output (function or DOM node)
+
If this is a function, it will be called for each token with + two arguments, the token's text and the token's style class (may + be null for unstyled tokens). If it is a DOM node, + the tokens will be converted to span elements as in + an editor, and inserted into the node + (through innerHTML).
+
+ + +