This template uses CodeMirror as code editor to be used in this template. To know more about CodeMirror, click the buttons below

XML/HTML Mode

The XML mode supports two configuration parameters htmlMode and alignCDATA. To learn more visit here. To view more languages visit here

1
<html style="color: green">
2
  <!-- this is a comment -->
3
  <head>
4
    <title>HTML Example</title>
5
  </head>
6
  <body>
7
    The indentation tries to be <em>somewhat &quot;do what
8
    I mean&quot;</em>... but might not match your style.
9
  </body>
10
</html>
 

Code Editor Theme

The code editor comes with different themes such as below. You can view more theme demos from the CodeMirror site by going here

1
function findSequence(goal) {
2
  function find(start, history) {
3
    if (start == goal)
4
      return history;
5
    else if (start > goal)
6
      return null;
7
    else
8
      return find(start + 5, "(" + history + " + 5)") ||
9
             find(start * 3, "(" + history + " * 3)");
10
  }
11
  return find(1, "1");
12
}
 

AutoFormatting Of Code

Select a piece of code and click one of the links below to apply automatic formatting to the selected text or comment/uncomment the selected text. Note that the formatting behavior depends on the current block's mode.

x
1
function (s,e){ for(var i=0; i < 1; i++) test("test();a=1");}
2
function test(c){  for (var i = 0; i < 10; i++){                  process("a.b();c = null;", 300);}
3
}
test 1
test 2