Skip to content

Commit

Permalink
more improvements to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaong committed Jul 13, 2020
1 parent 10acaee commit 67791f1
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 57 deletions.
34 changes: 13 additions & 21 deletions docs/MiniSearch.html
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ <h4 class="name" id=".getDefault"><span class="type-signature">(static) </span>g

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line540">line 540</a>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line535">line 535</a>
</li></ul></dd>


Expand Down Expand Up @@ -818,7 +818,7 @@ <h4 class="name" id=".loadJSON"><span class="type-signature">(static) </span>loa

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line513">line 513</a>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line508">line 508</a>
</li></ul></dd>


Expand Down Expand Up @@ -876,15 +876,10 @@ <h5>Example</h5>
<pre class="prettyprint"><code>// If the index was serialized with:
let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
miniSearch.addAll(documents)

const json = JSON.stringify(miniSearch)
// It can later be deserialized like this:
miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })

**Warning:** JSON (de)serialization of the index is currently tightly
coupled to the index implementation. For this reason, the current
implementation is to be considered a _beta_ feature, subject to breaking
changes changes in future releases. If a breaking change is introduced,
though, it will be properly reported in the changelog.</code></pre>
miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })</code></pre>



Expand Down Expand Up @@ -2669,7 +2664,7 @@ <h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line648">line 648</a>
<a href="MiniSearch.js.html">MiniSearch.js</a>, <a href="MiniSearch.js.html#line640">line 640</a>
</li></ul></dd>


Expand Down Expand Up @@ -2711,9 +2706,11 @@ <h4 class="name" id="toJSON"><span class="type-signature"></span>toJSON<span cla
<div class="description usertext">
<p>Allows serialization of the index to JSON, to possibly store it and later
deserialize it with <code>MiniSearch.loadJSON</code>.</p>
<p>Normally one does not directly call this method, but rather call
the standard JavaScript <code>JSON.stringify()</code> passing the <code>MiniSearch</code>
instance, and JavaScript will internally call this method:</p>
<p>Normally one does not directly call this method, but rather call the
standard JavaScript <code>JSON.stringify()</code> passing the <code>MiniSearch</code> instance,
and JavaScript will internally call this method. Upon deserialization, one
must pass to <code>loadJSON</code> the same options used to create the original
instance that was serialized.</p>
</div>


Expand All @@ -2730,14 +2727,9 @@ <h5>Example</h5>
let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
miniSearch.addAll(documents)
const json = JSON.stringify(miniSearch)
// Later, to deserialize:
miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })

**Warning:** JSON (de)serialization of the index is currently tightly
coupled to the index implementation. For this reason, the current
implementation is to be considered a _beta_ feature, subject to breaking
changes changes in future releases. If a breaking change is introduced,
though, it will be reported in the changelog.</code></pre>
// Later, to deserialize it:
miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })</code></pre>



Expand Down Expand Up @@ -3858,7 +3850,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
26 changes: 9 additions & 17 deletions docs/MiniSearch.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -542,16 +542,11 @@ <h1 class="page-title">MiniSearch.js</h1>
* // If the index was serialized with:
* let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
* miniSearch.addAll(documents)
*
* const json = JSON.stringify(miniSearch)
* // It can later be deserialized like this:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* **Warning:** JSON (de)serialization of the index is currently tightly
* coupled to the index implementation. For this reason, the current
* implementation is to be considered a _beta_ feature, subject to breaking
* changes changes in future releases. If a breaking change is introduced,
* though, it will be properly reported in the changelog.
*
* @param {string} json - JSON-serialized index
* @param {Object} options - configuration options, same as the constructor
* @return {MiniSearch} an instance of MiniSearch
Expand Down Expand Up @@ -671,23 +666,20 @@ <h1 class="page-title">MiniSearch.js</h1>
* Allows serialization of the index to JSON, to possibly store it and later
* deserialize it with `MiniSearch.loadJSON`.
*
* Normally one does not directly call this method, but rather call
* the standard JavaScript `JSON.stringify()` passing the `MiniSearch`
* instance, and JavaScript will internally call this method:
* Normally one does not directly call this method, but rather call the
* standard JavaScript `JSON.stringify()` passing the `MiniSearch` instance,
* and JavaScript will internally call this method. Upon deserialization, one
* must pass to `loadJSON` the same options used to create the original
* instance that was serialized.
*
* @example
* // Serialize the index:
* let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
* miniSearch.addAll(documents)
* const json = JSON.stringify(miniSearch)
* // Later, to deserialize:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* **Warning:** JSON (de)serialization of the index is currently tightly
* coupled to the index implementation. For this reason, the current
* implementation is to be considered a _beta_ feature, subject to breaking
* changes changes in future releases. If a breaking change is introduced,
* though, it will be reported in the changelog.
* // Later, to deserialize it:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* @return {Object} the serializeable representation of the search index
*/
Expand Down Expand Up @@ -900,7 +892,7 @@ <h1 class="page-title">MiniSearch.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

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

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

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

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> 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 @@ -334,7 +334,7 @@ <h2>Contributing</h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:17:06 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.4</a> on Mon Jul 13 2020 11:23:16 GMT+0200 (Central European Summer Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
24 changes: 8 additions & 16 deletions src/MiniSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,16 +496,11 @@ class MiniSearch {
* // If the index was serialized with:
* let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
* miniSearch.addAll(documents)
*
* const json = JSON.stringify(miniSearch)
* // It can later be deserialized like this:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* **Warning:** JSON (de)serialization of the index is currently tightly
* coupled to the index implementation. For this reason, the current
* implementation is to be considered a _beta_ feature, subject to breaking
* changes changes in future releases. If a breaking change is introduced,
* though, it will be properly reported in the changelog.
*
* @param {string} json - JSON-serialized index
* @param {Object} options - configuration options, same as the constructor
* @return {MiniSearch} an instance of MiniSearch
Expand Down Expand Up @@ -625,23 +620,20 @@ class MiniSearch {
* Allows serialization of the index to JSON, to possibly store it and later
* deserialize it with `MiniSearch.loadJSON`.
*
* Normally one does not directly call this method, but rather call
* the standard JavaScript `JSON.stringify()` passing the `MiniSearch`
* instance, and JavaScript will internally call this method:
* Normally one does not directly call this method, but rather call the
* standard JavaScript `JSON.stringify()` passing the `MiniSearch` instance,
* and JavaScript will internally call this method. Upon deserialization, one
* must pass to `loadJSON` the same options used to create the original
* instance that was serialized.
*
* @example
* // Serialize the index:
* let miniSearch = new MiniSearch({ fields: ['title', 'text'] })
* miniSearch.addAll(documents)
* const json = JSON.stringify(miniSearch)
* // Later, to deserialize:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* **Warning:** JSON (de)serialization of the index is currently tightly
* coupled to the index implementation. For this reason, the current
* implementation is to be considered a _beta_ feature, subject to breaking
* changes changes in future releases. If a breaking change is introduced,
* though, it will be reported in the changelog.
* // Later, to deserialize it:
* miniSearch = MiniSearch.loadJSON(json, { fields: ['title', 'text'] })
*
* @return {Object} the serializeable representation of the search index
*/
Expand Down

0 comments on commit 67791f1

Please sign in to comment.