yjs/doc/class/Directive.html
2014-08-12 19:18:56 +02:00

262 lines
7.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Yatta'>
Yatta
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>Directive</span>
</div>
</div>
<div id='content'>
<h1>
Class:
Directive
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>node_modules&#47;grunt-codo&#47;node_modules&#47;codo&#47;node_modules&#47;haml-coffee&#47;src&#47;nodes&#47;directive.coffee</td>
</tr>
<tr>
<td>Inherits:</td>
<td>
<a href='../class/Node.html'>Node</a>
</td>
</tr>
</table>
<h2>Overview</h2>
<div class='docstring'>
<p>Directive node for HAML statements that change the meaning or do interact
uniquely with the HAML document.</p>
<div class='examples'>
<h3>Examples:</h3>
<h4>
include a HAML document inside of another
</h4>
<pre><code class='coffeescript'>+include &#39;path&#47;to&#47;template&#39;[, context]</code></pre>
</div>
</div>
<div class='tags'>
</div>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='directives-variable'>
directives
=
</dt>
<dd>
<pre><code class='coffeescript'>{
&#47;*
Includes a HAML document inside of the current one. Context included
template is defaulted to the context of this template but may be changed
by passing a second argument.
@example Include with default context
+include &#39;path&#47;to&#47;template&#39;
@example Include with custom context
+include &#39;path&#47;to&#47;template&#39;, @context
*&#47;
include: function(expression) {
var Compiler, code, compiler, context, e, error, name, source, statement, _ref;
try {
_ref = expression.match(&#47;\s*[&#39;&quot;](.*?)[&#39;&quot;](?:,\s*(.*))?\s*&#47;), _ref[0], name = _ref[1], context = _ref[2];
} catch (_error) {
e = _error;
throw new Error(&quot;Failed to parse the include directive from &quot; + expression);
}
if (!context) {
context = &#39;this&#39;;
}
statement = (function() {
switch (this.placement) {
case &#39;global&#39;:
return &quot;&quot; + this.namespace + &quot;[&#39;&quot; + name + &quot;&#39;](&quot; + context + &quot;)&quot;;
case &#39;amd&#39;:
return &quot;require(&#39;&quot; + name + &quot;&#39;)(&quot; + context + &quot;)&quot;;
case &#39;standalone&#39;:
if (typeof browser !== &quot;undefined&quot; &amp;&amp; browser !== null ? browser.process : void 0) {
throw new Error(&quot;Include directive not available in the Browser when placement is standalone.&quot;);
} else {
try {
source = fs.readFileSync(name).toString();
} catch (_error) {
error = _error;
console.error(&quot; Error opening file: %s&quot;, error);
console.error(error);
}
&#47;*
Compile and build the source function.
*&#47;
Compiler = require(&#39;..&#47;haml-coffee&#39;);
compiler = new Compiler(this.options);
compiler.parse(source);
code = CoffeeScript.compile(compiler.precompile(), {
bare: true
});
return statement = &quot;`(function(){&quot; + code + &quot;}).apply(&quot; + context + &quot;)`&quot;;
}
break;
default:
throw new Error(&quot;Include directive not available when placement is &quot; + this.placement);
}
}).call(this);
return this.opener = this.markInsertingCode(statement, false);
}
}</code></pre>
<div class='docstring'>
<p>Map of available directives to methods.</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h3 class='inherited'>
Variable inherited from
<a href='../class/Node.html'>Node</a>
</h3>
<p class='inherited'>
<a href='../class/Node.html#CLEAR_WHITESPACE_LEFT-variable'>CLEAR_WHITESPACE_LEFT</a>
<a href='../class/Node.html#CLEAR_WHITESPACE_RIGHT-variable'>CLEAR_WHITESPACE_RIGHT</a>
</p>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#evaluate-dynamic'>
#
(void)
<b>evaluate</b><span>()</span>
</a>
</span>
<span class='desc'>
Evaluate the Haml directive.
</span>
</li>
</ul>
<h2>
<small>Inherited Method Summary</small>
<h3 class='inherited'>
Methods inherited from
<a href='../class/Node.html'>Node</a>
</h3>
<p class='inherited'>
<a href='../class/Node.html#addChild-dynamic'>#addChild</a>
<a href='../class/Node.html#getOpener-dynamic'>#getOpener</a>
<a href='../class/Node.html#getCloser-dynamic'>#getCloser</a>
<a href='../class/Node.html#isPreserved-dynamic'>#isPreserved</a>
<a href='../class/Node.html#isCommented-dynamic'>#isCommented</a>
<a href='../class/Node.html#markText-dynamic'>#markText</a>
<a href='../class/Node.html#markRunningCode-dynamic'>#markRunningCode</a>
<a href='../class/Node.html#markInsertingCode-dynamic'>#markInsertingCode</a>
<a href='../class/Node.html#evaluate-dynamic'>#evaluate</a>
<a href='../class/Node.html#render-dynamic'>#render</a>
</p>
</h2>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='evaluate-dynamic'>
#
(void)
<b>evaluate</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Evaluate the Haml directive.</p>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
August 12, 14 06:33:02 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>