Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolarosa committed May 31, 2024
1 parent fdc36da commit 7f262ff
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 30 deletions.
77 changes: 58 additions & 19 deletions docs/CrateManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h4 class="name" id="__normaliseContext"><span class="type-signature"></span>__n

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1397">line 1397</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1409">line 1409</a>
</li></ul></dd>


Expand Down Expand Up @@ -724,7 +724,7 @@ <h4 class="name" id="addFile"><span class="type-signature"></span>addFile<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line784">line 784</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line795">line 795</a>
</li></ul></dd>


Expand Down Expand Up @@ -807,6 +807,19 @@ <h5>Parameters:</h5>



<div class="section-returns">
<h5>Returns:</h5>




<div class="param-desc">
<p>the entity</p>
</div>


</div>



<div class="section-examples">
Expand Down Expand Up @@ -869,7 +882,7 @@ <h4 class="name" id="addFileOrFolder"><span class="type-signature"></span>addFil

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line716">line 716</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line717">line 717</a>
</li></ul></dd>


Expand Down Expand Up @@ -1029,6 +1042,19 @@ <h5>Parameters:</h5>



<div class="section-returns">
<h5>Returns:</h5>




<div class="param-desc">
<p>the entity</p>
</div>


</div>



<div class="section-examples">
Expand Down Expand Up @@ -1091,7 +1117,7 @@ <h4 class="name" id="addFolder"><span class="type-signature"></span>addFolder<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line801">line 801</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line813">line 813</a>
</li></ul></dd>


Expand Down Expand Up @@ -1174,13 +1200,26 @@ <h5>Parameters:</h5>



<div class="section-returns">
<h5>Returns:</h5>




<div class="param-desc">
<p>the entity</p>
</div>


</div>



<div class="section-examples">
<h5>Example</h5>

<pre class="prettyprint"><code>const cm = new CrateManager({ crate })
let r = cm.addFile('/a/b/c/file.txt);</code></pre>
let r = cm.addFolder('/a/b/c);</code></pre>

</div>

Expand Down Expand Up @@ -1234,7 +1273,7 @@ <h4 class="name" id="deleteEntity"><span class="type-signature"></span>deleteEnt

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line818">line 818</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line830">line 830</a>
</li></ul></dd>


Expand Down Expand Up @@ -1441,7 +1480,7 @@ <h4 class="name" id="deleteProperty"><span class="type-signature"></span>deleteP

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1012">line 1012</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1024">line 1024</a>
</li></ul></dd>


Expand Down Expand Up @@ -1662,7 +1701,7 @@ <h4 class="name" id="exportCrate"><span class="type-signature"></span>exportCrat

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1274">line 1274</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1286">line 1286</a>
</li></ul></dd>


Expand Down Expand Up @@ -1770,7 +1809,7 @@ <h4 class="name" id="exportEntityTemplate"><span class="type-signature"></span>e

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1325">line 1325</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1337">line 1337</a>
</li></ul></dd>


Expand Down Expand Up @@ -2004,7 +2043,7 @@ <h4 class="name" id="flatten"><span class="type-signature"></span>flatten<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1088">line 1088</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1100">line 1100</a>
</li></ul></dd>


Expand Down Expand Up @@ -2905,7 +2944,7 @@ <h4 class="name" id="getErrors"><span class="type-signature"></span>getErrors<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1366">line 1366</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1378">line 1378</a>
</li></ul></dd>


Expand Down Expand Up @@ -3113,7 +3152,7 @@ <h4 class="name" id="getWarnings"><span class="type-signature"></span>getWarning

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1375">line 1375</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1387">line 1387</a>
</li></ul></dd>


Expand Down Expand Up @@ -3217,7 +3256,7 @@ <h4 class="name" id="ingestAndLink"><span class="type-signature"></span>ingestAn

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1048">line 1048</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1060">line 1060</a>
</li></ul></dd>


Expand Down Expand Up @@ -3471,7 +3510,7 @@ <h4 class="name" id="linkEntity"><span class="type-signature"></span>linkEntity<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1124">line 1124</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1136">line 1136</a>
</li></ul></dd>


Expand Down Expand Up @@ -3869,7 +3908,7 @@ <h4 class="name" id="purgeUnlinkedEntities"><span class="type-signature"></span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1230">line 1230</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1242">line 1242</a>
</li></ul></dd>


Expand Down Expand Up @@ -4412,7 +4451,7 @@ <h4 class="name" id="setProperty"><span class="type-signature"></span>setPropert

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line893">line 893</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line905">line 905</a>
</li></ul></dd>


Expand Down Expand Up @@ -4681,7 +4720,7 @@ <h4 class="name" id="unlinkEntity"><span class="type-signature"></span>unlinkEnt

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1162">line 1162</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line1174">line 1174</a>
</li></ul></dd>


Expand Down Expand Up @@ -4928,7 +4967,7 @@ <h4 class="name" id="updateProperty"><span class="type-signature"></span>updateP

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line949">line 949</a>
<a href="crate-manager.js.html">crate-manager.js</a>, <a href="crate-manager.js.html#line961">line 961</a>
</li></ul></dd>


Expand Down Expand Up @@ -5170,7 +5209,7 @@ <h5>Example</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/ProfileManager.html
Original file line number Diff line number Diff line change
Expand Up @@ -1745,7 +1745,7 @@ <h4 class="name" id="mapTypeHierarchies"><span class="type-signature"></span>map
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
24 changes: 18 additions & 6 deletions docs/crate-manager.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ <h1 class="page-title">crate-manager.js</h1>
* @param {object} params
* @param {string} params.path - a file or folder path
* @param {string} params.type - the type of thing being added - File or Dataset
* @returns the entity
* @example

const cm = new CrateManager({ crate })
Expand All @@ -759,6 +760,11 @@ <h1 class="page-title">crate-manager.js</h1>
throw new Error(`'addFileOrFolder' type must be File or Dataset`);
}

// ensure folders end in '/'
if (type === "Dataset" &amp;&amp; !path.match(/.*\/$/)) {
path = `${path}/`;
}

// remove initial slash if there is one
if (path.match(/^\//)) {
path = path.substring(1);
Expand Down Expand Up @@ -801,12 +807,16 @@ <h1 class="page-title">crate-manager.js</h1>
"@type": [type],
name: path,
};

this.ingestAndLink({
const sourceEntity = this.getEntity({
id: paths.length ? paths.slice(-1)[0]["@id"] : "./",
stub: true,
});
this.ingestAndLink({
id: sourceEntity["@id"],
property: "hasPart",
json: entity,
});
return this.getEntity({ id: entity["@id"], stub: true });
}

/**
Expand All @@ -817,13 +827,14 @@ <h1 class="page-title">crate-manager.js</h1>
* property as required. It is assumed that the path is relative to the root of the folder.
*
* @param {string} path - a file path to add - ensure the file path is relative to the folder root
* @returns the entity
* @example

const cm = new CrateManager({ crate })
let r = cm.addFile('/a/b/c/file.txt);
*/
addFile(path) {
this.addFileOrFolder({ path, type: "File" });
return this.addFileOrFolder({ path, type: "File" });
}

/**
Expand All @@ -834,13 +845,14 @@ <h1 class="page-title">crate-manager.js</h1>
* property as required. It is assumed that the path is relative to the root of the folder.
*
* @param {string} path - a folder path to add - ensure the folder path is relative to the folder root
* @returns the entity
* @example

const cm = new CrateManager({ crate })
let r = cm.addFile('/a/b/c/file.txt);
let r = cm.addFolder('/a/b/c);
*/
addFolder(path) {
this.addFileOrFolder({ path, type: "Dataset" });
return this.addFileOrFolder({ path, type: "Dataset" });
}

/**
Expand Down Expand Up @@ -1638,7 +1650,7 @@ <h1 class="page-title">crate-manager.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h1 id="repository-structure">Repository structure</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ <h1 class="page-title">lib.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/profile-manager.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ <h1 class="page-title">profile-manager.js</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:39:13 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.3</a> on Fri May 31 2024 13:57:25 GMT+1000 (Australian Eastern Standard Time) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down

0 comments on commit 7f262ff

Please sign in to comment.