Sha256: 847520261482f92874463f209a9a51e5fd6b937ac9faf197f3e9894b98377317

Contents?: true

Size: 1.53 KB

Versions: 17

Compression:

Stored size: 1.53 KB

Contents

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Static Code highlighter using Ace</title>
	<meta name="author" content="Matthew Kastor">
    <style type="text/css">
        .code {
            width: 50%;
            position: relative;
            white-space: pre-wrap;
        }
    </style>
</head>
<body>

<h2>Client Side Syntax Highlighting</h2>

<p>Syntax highlighting using Ace language modes and themes.</p>

<div class="code" ace-mode="ace/mode/css" ace-theme="ace/theme/chrome" ace-gutter="true">
.code {
    width: 50%;
    
    position: relative;
    white-space: pre-wrap;
}

</div>

<pre class="code" ace-mode="ace/mode/javascript" ace-theme="ace/theme/twilight">
function wobble (flam) {
    return flam.wobbled = true;
}

</pre>

<!-- load ace -->
<script src="../src/ace.js"></script>
<!-- load ace static_highlight extension -->
<script src="../src/ext-static_highlight.js"></script>
<script>
    var highlight = ace.require("ace/ext/static_highlight")
    var dom = ace.require("ace/lib/dom")
    function qsa(sel) {
        return Array.apply(null, document.querySelectorAll(sel));
    }

    qsa(".code").forEach(function (codeEl) {
        highlight(codeEl, {
            mode: codeEl.getAttribute("ace-mode"),
            theme: codeEl.getAttribute("ace-theme"),
            startLineNumber: 1,
            showGutter: codeEl.getAttribute("ace-gutter"),
            trim: true
        }, function (highlighted) {
            
        });
    });
</script>

</body>
</html>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
agile-proxy-0.1.24 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.23 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.22 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.21 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.20 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.19 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.18 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.13 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.12 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.11 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.10 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.9 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.8 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.7 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.6 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.5 assets/ui/bower_components/ace-builds/demo/static-highlighter.html
agile-proxy-0.1.4 assets/ui/bower_components/ace-builds/demo/static-highlighter.html