json-timeline
Version:
Generate Interactive Timelines stored in JSON Advents with Tags.
1,825 lines (461 loc) • 19.4 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: json-timeline</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Module: json-timeline</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description">CLI for generating Timelines</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>adventsPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Path to Advents Directory</td>
</tr>
<tr>
<td class="name"><code>outputPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Path to Output Directory</td>
</tr>
<tr>
<td class="name"><code>flags</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Flags: v = verbose, f = force</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line2">line 2</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="~FLAGS"><span class="type-signature">(inner, constant) </span>FLAGS<span class="type-signature"> :Object</span></h4>
<div class="description">
Boolean flags for CLI Argument flags
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line16">line 16</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="~checkAdventsDirectory"><span class="type-signature">(inner) </span>checkAdventsDirectory<span class="signature">(adventsPath)</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Check if the Advents Input Path is an Existing Directory
</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>adventsPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Advents Input Path</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if the Advents Input Path is not an Existing Directory
</div>
<h5>Returns:</h5>
<div class="param-desc">
Advents Path
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="~checkAdventsDirectory"><span class="type-signature">(inner) </span>checkAdventsDirectory<span class="signature">(outputPath)</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Check and Make a Directory of the Output Input Path
</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>outputPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Output Input Path</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line112">line 112</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if the Output Input Path Exists but is not a Directory
</div>
<h5>Returns:</h5>
<div class="param-desc">
Output Path
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="~copyFile"><span class="type-signature">(inner) </span>copyFile<span class="signature">(sourcePath, destPath)</span><span class="type-signature"></span></h4>
<div class="description">
Copies Source File to Destination File
</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>sourcePath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Path to Source File</td>
</tr>
<tr>
<td class="name"><code>destPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Path to Destination File</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line167">line 167</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~handleArguments"><span class="type-signature">(inner) </span>handleArguments<span class="signature">(args)</span><span class="type-signature"> → {Array.<string>}</span></h4>
<div class="description">
Handles CLI Arguments for Paths and Flags
</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>args</code></td>
<td class="type">
<span class="param-type">Array.<string></span>
</td>
<td class="description last">[advents, output, flags] CLI arguments</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line43">line 43</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if advents or output are undefined
</div>
<h5>Returns:</h5>
<div class="param-desc">
Advents and Output Paths
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array.<string></span>
</dd>
</dl>
<h4 class="name" id="~processAdvents"><span class="type-signature">(inner) </span>processAdvents<span class="signature">(adventsPath)</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Process and Return Advents from Advents Directory
</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>adventsPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Advents Path</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line82">line 82</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if failed to load Advents
</div>
<h5>Returns:</h5>
<div class="param-desc">
advents.js File Contents
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="~str"><span class="type-signature">(inner) </span>str<span class="signature">(input)</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Wrapper for consistent JSON.stringify
</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>input</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">Input Argument</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line101">line 101</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Stringified Input
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id="~vLog"><span class="type-signature">(inner) </span>vLog<span class="signature">(message, opts)</span><span class="type-signature"></span></h4>
<div class="description">
Log a message with Level based on Verbose
</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>message</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Message to Log</td>
</tr>
<tr>
<td class="name"><code>opts</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Options for Level and Verbose</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line201">line 201</a>
</li></ul></dd>
</dl>
<h4 class="name" id="~writeAdvents"><span class="type-signature">(inner) </span>writeAdvents<span class="signature">(destPath, content)</span><span class="type-signature"></span></h4>
<div class="description">
Write advents.js content to Destination File
</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>destPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Destination Path</td>
</tr>
<tr>
<td class="name"><code>content</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Content to write to Destination File</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line178">line 178</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if the Destination Path is not a file
</div>
<h4 class="name" id="~writeViewFiles"><span class="type-signature">(inner) </span>writeViewFiles<span class="signature">(outputPath)</span><span class="type-signature"></span></h4>
<div class="description">
Write files in view/ to Output Directory, overwriting if the
force flag is true
</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>outputPath</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">Output Path</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="json-timeline.js.html">json-timeline.js</a>, <a href="json-timeline.js.html#line135">line 135</a>
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
An Error if an Output Destination File Path is not a file
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-advents.html">advents</a></li><li><a href="module-compareDates.html">compareDates</a></li><li><a href="module-groupAdvents.html">groupAdvents</a></li><li><a href="module-index.html">index</a></li><li><a href="module-isType.html">isType</a></li><li><a href="module-json-timeline.html">json-timeline</a></li><li><a href="module-loadAdvents.html">loadAdvents</a></li><li><a href="module-renderAdvents.html">renderAdvents</a></li><li><a href="module-schemas.html">schemas</a></li><li><a href="module-sortAdvents.html">sortAdvents</a></li><li><a href="module-validateSchema.html">validateSchema</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.6</a> on Mon Dec 14 2020 23:14:56 GMT-0500 (Eastern Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>