Code Editor Subtitle goes here...
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 "do what
8
I mean"</em>... but might not match your style.
9
</body>
10
</html>
11
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
}
13
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
<script> function (s,e){ for(var i=0; i < 1; i++) test("test();a=1");} </script>
2
<script>
3
function test(c){ for (var i = 0; i < 10; i++){ process("a.b();c = null;", 300);}
4
}
5
</script>
6
<table><tr><td>test 1</td></tr><tr><td>test 2</td></tr></table>
7
<script> function test() { return 1;} </script>
8
<style> .test { font-size: medium; font-family: monospace; }
9
</style>