Skip to content

Instantly share code, notes, and snippets.

@esironal
Last active May 10, 2024 23:07
Show Gist options
  • Save esironal/7209a7c00cba5267321d to your computer and use it in GitHub Desktop.
Save esironal/7209a7c00cba5267321d to your computer and use it in GitHub Desktop.
Codemirror CDN
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Code Mirror CDN</title>
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/lib/codemirror.css">
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/addon/hint/show-hint.css">
<script src="http://esironal.github.io/cmtouch/lib/codemirror.js"></script>
<script src="http://esironal.github.io/cmtouch/addon/hint/show-hint.js"></script>
<script src="http://esironal.github.io/cmtouch/addon/hint/xml-hint.js"></script>
<script src="http://esironal.github.io/cmtouch/addon/hint/html-hint.js"></script>
<script src="http://esironal.github.io/cmtouch/mode/xml/xml.js"></script>
<script src="http://esironal.github.io/cmtouch/mode/javascript/javascript.js"></script>
<script src="http://esironal.github.io/cmtouch/mode/css/css.js"></script>
<script src="http://esironal.github.io/cmtouch/mode/htmlmixed/htmlmixed.js"></script>
<script src="http://esironal.github.io/cmtouch/addon/selection/active-line.js"></script>
<script src="http://esironal.github.io/cmtouch/addon/edit/matchbrackets.js"></script>
<link rel="stylesheet" href="http://esironal.github.io/cmtouch/theme/neonsyntax.css">
<style type="text/css">
.CodeMirror {
font-size: 15px;
width: 100%, ;
height: 100%;
}
</style>
</head>
<body>
<!-- This is an awsome comment -->
<div id="code"></div>
<script type="text/javascript">
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.hint.html);
}
window.onload = function() {
editor = CodeMirror(document.getElementById("code"), {
mode: "text/html",
theme: "neonsyntax",
lineWrapping: true,
lineNumbers: true,
styleActiveLine: true,
matchBrackets: true,
extraKeys: {
"Ctrl-Space": "autocomplete"
},
value: "<!doctype html>\n<html>\n " + document.documentElement.innerHTML + "\n</html>"
});
};
</script>
</body>
</html>
@anonyco
Copy link

anonyco commented Apr 16, 2018

Please do not use this. Github.io was not intended to be used as a CDN

@hasiba85
Copy link

hasiba85 commented Nov 5, 2022

nice

@prmichaelsen
Copy link

@anonyco This is an example on how to use CDN, not a CDN itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment