Skip to content

Commit

Permalink
fix description
Browse files Browse the repository at this point in the history
  • Loading branch information
kanasimi committed Feb 6, 2024
1 parent 2248942 commit bf55710
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 71 deletions.
4 changes: 3 additions & 1 deletion Wikiapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,9 @@ function Wikiapi_SPARQL(SPARQL, options) {
// --------------------------------------------------------

/**
*
* @description Tool function to access page list.<br />
* Please refer to <a href="https://github.com/kanasimi/CeJS/blob/master/application/net/wiki/list.js#:~:text=get_list.type%20=">all supported types</a> (search "get_list.type =").
*
* @example <caption>get list of [[w:en:Category:Chemical_elements]]</caption>
// <code>
const wiki = new Wikiapi;
Expand Down
34 changes: 17 additions & 17 deletions docs/Wikiapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ <h4 class="name" id=".KEY_subcategories"><span class="type-signature">(static) <

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1371">line 1371</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1373">line 1373</a>
</li></ul></dd>


Expand Down Expand Up @@ -380,7 +380,7 @@ <h4 class="name" id="category_tree"><span class="type-signature"></span>category

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1347">line 1347</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1349">line 1349</a>
</li></ul></dd>


Expand Down Expand Up @@ -600,7 +600,7 @@ <h4 class="name" id="convert_Chinese"><span class="type-signature"></span>conver

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1881">line 1881</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1883">line 1883</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2077">line 2077</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2079">line 2079</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1732">line 1732</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1734">line 1734</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2125">line 2125</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2127">line 2127</a>
</li></ul></dd>


Expand Down Expand Up @@ -2039,7 +2039,7 @@ <h4 class="name" id="for_each_page"><span class="type-signature"></span>for_each

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1806">line 1806</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1808">line 1808</a>
</li></ul></dd>


Expand Down Expand Up @@ -2318,7 +2318,7 @@ <h4 class="name" id="get_featured_content"><span class="type-signature"></span>g

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1996">line 1996</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1998">line 1998</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2158">line 2158</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2160">line 2160</a>
</li></ul></dd>


Expand Down Expand Up @@ -4328,7 +4328,7 @@ <h4 class="name" id="redirects_here"><span class="type-signature"></span>redirec

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1463">line 1463</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1465">line 1465</a>
</li></ul></dd>


Expand Down Expand Up @@ -4538,7 +4538,7 @@ <h4 class="name" id="redirects_root"><span class="type-signature"></span>redirec

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1426">line 1426</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1428">line 1428</a>
</li></ul></dd>


Expand Down Expand Up @@ -4748,7 +4748,7 @@ <h4 class="name" id="register_redirects"><span class="type-signature"></span>reg

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1546">line 1546</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1548">line 1548</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1392">line 1392</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1394">line 1394</a>
</li></ul></dd>


Expand Down Expand Up @@ -5215,7 +5215,7 @@ <h4 class="name" id="setup_layout_element_to_insert"><span class="type-signature

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1957">line 1957</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1959">line 1959</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2050">line 2050</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line2052">line 2052</a>
</li></ul></dd>


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

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1653">line 1653</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1655">line 1655</a>
</li></ul></dd>


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

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Feb 06 2024 13:48:44 GMT+0800 (台北標準時間) 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.10</a> on Tue Feb 06 2024 15:05:20 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
104 changes: 54 additions & 50 deletions docs/global.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h4 class="name" id="for_each_page_in_list"><span class="type-signature"></span>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1150">line 1150</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1152">line 1152</a>
</li></ul></dd>


Expand Down Expand Up @@ -193,8 +193,8 @@ <h5>Example</h5>

<p class="code-caption">List all redirected categories</p>

<pre class="prettyprint"><code>// &lt;code>
await wiki.for_each_page_in_list('allredirects', page_data => console.log('page_data: ', page_data), { namespace: 'Category' });
<pre class="prettyprint"><code>// &lt;code>
await wiki.for_each_page_in_list('allredirects', page_data => console.log('page_data: ', page_data), { namespace: 'Category' });
// &lt;/code></code></pre>


Expand Down Expand Up @@ -408,7 +408,7 @@ <h4 class="name" id="Wikiapi_list"><span class="type-signature"></span>Wikiapi_l

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1075">line 1075</a>
<a href="wikiapi.js.html">wikiapi.js</a>, <a href="wikiapi.js.html#line1077">line 1077</a>
</li></ul></dd>


Expand Down Expand Up @@ -447,6 +447,10 @@ <h4 class="name" id="Wikiapi_list"><span class="type-signature"></span>Wikiapi_l



<div class="description usertext">
Tool function to access page lists.<br />Please refer to <a href="https://github.com/kanasimi/CeJS/blob/master/application/net/wiki/list.js#:~:text=get_list.type%20=">all supported types</a> (search "get_list.type =").
</div>




Expand All @@ -459,67 +463,67 @@ <h5>Examples</h5>

<p class="code-caption">get list of [[w:en:Category:Chemical_elements]]</p>

<pre class="prettyprint"><code>// &lt;code>
const wiki = new Wikiapi;
let page_list = await wiki.categorymembers('Chemical elements');
console.log(page_list);
// Working on multiple pages
await wiki.for_each_page(
// {Array} title liat / page data list
page_list,
page_data => {
// ...
});
<pre class="prettyprint"><code>// &lt;code>
const wiki = new Wikiapi;
let page_list = await wiki.categorymembers('Chemical elements');
console.log(page_list);
// Working on multiple pages
await wiki.for_each_page(
// {Array} title liat / page data list
page_list,
page_data => {
// ...
});
// &lt;/code></code></pre>

<p class="code-caption">get pages transcluding {{w:en:Periodic table}}</p>

<pre class="prettyprint"><code>// &lt;code>
const wiki = new Wikiapi;
let page_list = await wiki.embeddedin('Template:Periodic table');
console.log(page_list);
<pre class="prettyprint"><code>// &lt;code>
const wiki = new Wikiapi;
let page_list = await wiki.embeddedin('Template:Periodic table');
console.log(page_list);
// &lt;/code></code></pre>

<p class="code-caption">Process each page of the category.</p>

<pre class="prettyprint"><code>// &lt;code>
// Get the list of all pages at once first.
const page_list = await wiki.categorymembers('Category:Articles not listed in the vital article list');
await page_list.each((page_data) => { }, options);

// Imperative code, for huge pages.
for await (const page_data of wiki.categorymembers('Category:Articles not listed in the vital article list')) {
console.trace(`page_data #${count}:`, page_data);
}

// Declarative code(?), for huge pages.
await wiki.categorymembers('Category:Articles not listed in the vital article list', {
for_each_page(page_data) {
console.log('page_data:', page_data);
}
});
<pre class="prettyprint"><code>// &lt;code>
// Get the list of all pages at once first.
const page_list = await wiki.categorymembers('Category:Articles not listed in the vital article list');
await page_list.each((page_data) => { }, options);

// Imperative code, for huge pages.
for await (const page_data of wiki.categorymembers('Category:Articles not listed in the vital article list')) {
console.trace(`page_data #${count}:`, page_data);
}

// Declarative code(?), for huge pages.
await wiki.categorymembers('Category:Articles not listed in the vital article list', {
for_each_page(page_data) {
console.log('page_data:', page_data);
}
});
// &lt;/code></code></pre>

<p class="code-caption">Process all pages.</p>

<pre class="prettyprint"><code>// &lt;code>
let count = 0;
for await (const page_data of wiki.allpages({ namespace: 'Talk', apfrom: wiki.remove_namespace('ABC') })) {
console.trace(`page_data #${count}:`, page_data);
if (++count > 5) break;
}
console.log('Done.');
<pre class="prettyprint"><code>// &lt;code>
let count = 0;
for await (const page_data of wiki.allpages({ namespace: 'Talk', apfrom: wiki.remove_namespace('ABC') })) {
console.trace(`page_data #${count}:`, page_data);
if (++count > 5) break;
}
console.log('Done.');
// &lt;/code></code></pre>

<p class="code-caption">Process all pages with batch_size.</p>

<pre class="prettyprint"><code>// &lt;code>
let count = 0;
for await (const page_list of wiki.allpages({ namespace: 'Talk', apfrom: wiki.remove_namespace('ABC'), batch_size: 5 })) {
console.trace('page_list:', page_list);
if (++count > 2) break;
}
console.log('Done.');
<pre class="prettyprint"><code>// &lt;code>
let count = 0;
for await (const page_list of wiki.allpages({ namespace: 'Talk', apfrom: wiki.remove_namespace('ABC'), batch_size: 5 })) {
console.trace('page_list:', page_list);
if (++count > 2) break;
}
console.log('Done.');
// &lt;/code></code></pre>


Expand Down Expand Up @@ -562,7 +566,7 @@ <h5>Examples</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Feb 06 2024 13:48:44 GMT+0800 (台北標準時間) 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.10</a> on Tue Feb 06 2024 15:05:20 GMT+0800 (台北標準時間) 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 @@ -466,7 +466,7 @@ <h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Feb 06 2024 13:48:44 GMT+0800 (台北標準時間) 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.10</a> on Tue Feb 06 2024 15:05:20 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
6 changes: 4 additions & 2 deletions docs/wikiapi.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,9 @@ <h1 class="page-title">wikiapi.js</h1>
// --------------------------------------------------------

/**
*
* @description Tool function to access page lists.&lt;br />
* Please refer to &lt;a href="https://github.com/kanasimi/CeJS/blob/master/application/net/wiki/list.js#:~:text=get_list.type%20=">all supported types&lt;/a> (search "get_list.type =").
*
* @example &lt;caption>get list of [[w:en:Category:Chemical_elements]]&lt;/caption>
// &lt;code>
const wiki = new Wikiapi;
Expand Down Expand Up @@ -2262,7 +2264,7 @@ <h1 class="page-title">wikiapi.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Tue Feb 06 2024 13:48:44 GMT+0800 (台北標準時間) 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.10</a> on Tue Feb 06 2024 15:05:20 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

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

0 comments on commit bf55710

Please sign in to comment.