metascript
Version:
Sophisticated meta programming in JavaScript, e.g. to build different versions of a library from a single source tree.
866 lines (267 loc) • 10.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="scripts/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-esoccer.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2>
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="dirname"><span class="type-signature"></span>dirname<span class="signature">(filename)</span><span class="type-signature"> → {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Extracts the directory name from a file name.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>filename</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>File name</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Directory name</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="escapestr"><span class="type-signature"></span>escapestr<span class="signature">(s)</span><span class="type-signature"> → {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Escaoes a string to be used inside of a single or double quote enclosed JavaScript string.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>String to escape</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Escaped string</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="include"><span class="type-signature"></span>include<span class="signature">(includeFile, absolute)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Includes another source file.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>includeFile</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>File to include. May be a glob expression on node.js.</p></td>
</tr>
<tr>
<td class="name"><code>absolute</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Whether the path is absolute, defaults to <code>false</code> for a relative path</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="indent"><span class="type-signature"></span>indent<span class="signature">(str, indent)</span><span class="type-signature"> → {string}</span></h4>
</dt>
<dd>
<div class="description">
<p>Indents a block of text.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>str</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>Text to indent</p></td>
</tr>
<tr>
<td class="name"><code>indent</code></td>
<td class="type">
<span class="param-type">string</span>
|
<span class="param-type">number</span>
</td>
<td class="description last"><p>Whitespace text to use for indentation or the number of whitespaces to use</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Indented text</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="write"><span class="type-signature"></span>write<span class="signature">(s)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Writes some contents to the document (no indentation).</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>Contents to write</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
<dt>
<h4 class="name" id="writeln"><span class="type-signature"></span>writeln<span class="signature">(s)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>Writes some contents to the document, followed by a new line.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last"><p>Contents to write</p></td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<nav-inner>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="MetaScript.html">MetaScript</a></li></ul><h3>Global</h3><ul><li><a href="global.html#dirname">dirname</a></li><li><a href="global.html#escapestr">escapestr</a></li><li><a href="global.html#include">include</a></li><li><a href="global.html#indent">indent</a></li><li><a href="global.html#write">write</a></li><li><a href="global.html#writeln">writeln</a></li></ul>
</nav-inner>
</nav>
<br clear="both">
<script> prettyPrint(); </script>
</body>
</html>