wide/static/js/lib/codemirror-4.10/mode/soy/index.html

69 lines
1.9 KiB
HTML
Raw Normal View History

2014-08-18 17:45:43 +04:00
<!doctype html>
2014-12-30 12:45:45 +03:00
<title>CodeMirror: Soy (Closure Template) mode</title>
2014-08-18 17:45:43 +04:00
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="../htmlmixed/htmlmixed.js"></script>
<script src="../xml/xml.js"></script>
<script src="../javascript/javascript.js"></script>
<script src="../css/css.js"></script>
2014-12-30 12:45:45 +03:00
<script src="soy.js"></script>
2014-08-18 17:45:43 +04:00
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
<div id=nav>
2014-10-27 10:49:58 +03:00
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
2014-08-18 17:45:43 +04:00
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
2014-10-27 10:49:58 +03:00
<li><a href="https://github.com/codemirror/codemirror">Code</a>
2014-08-18 17:45:43 +04:00
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
2014-12-30 12:45:45 +03:00
<li><a class=active href="#">Soy (Closure Template)</a>
2014-08-18 17:45:43 +04:00
</ul>
</div>
<article>
2014-12-30 12:45:45 +03:00
<h2>Soy (Closure Template) mode</h2>
2014-08-18 17:45:43 +04:00
<form><textarea id="code" name="code">
2014-12-30 12:45:45 +03:00
{namespace example}
2014-08-18 17:45:43 +04:00
2014-12-30 12:45:45 +03:00
/**
* Says hello to the world.
*/
{template .helloWorld}
{@param name: string}
{@param? score: number}
Hello <b>{$name}</b>!
<div>
{if $score}
<em>{$score} points</em>
{else}
no score
{/if}
</div>
{/template}
2014-08-18 17:45:43 +04:00
2014-12-30 12:45:45 +03:00
{template .alertHelloWorld kind="js"}
alert('Hello World');
{/template}
2014-08-18 17:45:43 +04:00
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
2014-12-30 12:45:45 +03:00
mode: "text/x-soy",
indentUnit: 2,
indentWithTabs: false
2014-08-18 17:45:43 +04:00
});
</script>
2014-12-30 12:45:45 +03:00
<p>A mode for <a href="https://developers.google.com/closure/templates/">Closure Templates</a> (Soy).</p>
<p><strong>MIME type defined:</strong> <code>text/x-soy</code>.</p>
2014-08-18 17:45:43 +04:00
</article>