diff --git a/Wikiapi.js b/Wikiapi.js
index 8aece10..fc92694 100644
--- a/Wikiapi.js
+++ b/Wikiapi.js
@@ -10,6 +10,8 @@
* @description CeJS controller
*
* @type Function
+ *
+ * @ignore
* @inner
*
* @see https://github.com/kanasimi/CeJS
@@ -53,6 +55,7 @@ CeL.run(['interact.DOM', 'application.debug',
/**
* @description syntactic sugar for CeJS MediaWiki module. CeL.net.wiki === CeL.wiki
*
+ * @ignore
* @inner
*/
const wiki_API = CeL.net.wiki;
@@ -61,6 +64,7 @@ const wiki_API = CeL.net.wiki;
*
* @type Symbol
*
+ * @ignore
* @inner
*/
const KEY_SESSION = wiki_API.KEY_SESSION;
@@ -74,6 +78,7 @@ wiki_API.set_language('en');
*
* @type Symbol
*
+ * @ignore
* @inner
*/
const KEY_wiki_session = Symbol('wiki_API session');
@@ -101,6 +106,7 @@ function Wikiapi(API_URL) {
*
* @param {wiki_API} wiki_session - wiki_API session
*
+ * @ignore
* @inner
*/
function setup_wiki_session(wiki_session) {
@@ -181,6 +187,7 @@ function Wikiapi_login(user_name, password, API_URL) {
*
* @type Object
*
+ * @ignore
* @inner
*/
const page_data_attributes = {
@@ -234,6 +241,7 @@ const page_data_attributes = {
*
* @returns {Promise} Promise object represents {Object} page's data
*
+ * @ignore
* @inner
*/
function set_page_data_attributes(page_data, wiki) {
@@ -247,7 +255,7 @@ function set_page_data_attributes(page_data, wiki) {
/**
* @alias page
- * @description given a title, returns the page's data.
+ * @description Given a title, returns the page's data.
*
* @param {String} title - page title
* @param {Object} [options] - options to run this function
@@ -378,6 +386,7 @@ function Wikiapi_tracking_revisions(title, to_search, options) {
*
* @returns {Boolean} Return true if the edit operation failed.
*
+ * @ignore
* @inner
*/
function reject_edit_error(reject, error, result) {
@@ -411,7 +420,7 @@ function reject_edit_error(reject, error, result) {
* @alias edit_page
* @description edits content of target page.
* Note: for multiple pages, you should use {@link Wikiapi#for_each_page}.
- * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
+ * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
*
* @param {String} title - page title
* @param {String|Function} content - 'wikitext page content' || page_data => 'wikitext'
@@ -738,6 +747,7 @@ function Wikiapi_purge(title, options) {
*
* @param {Object} data_entity - wiki_API data entity
*
+ * @ignore
* @inner
*/
function setup_data_entity(data_entity) {
@@ -761,6 +771,7 @@ function setup_data_entity(data_entity) {
*
* @returns {Promise} Promise object represents {Object} result data entity
*
+ * @ignore
* @inner
*/
function modify_data_entity(data_to_modify, options) {
@@ -1120,7 +1131,8 @@ function Wikiapi_list(list_type, title, options) {
/**
- * Syntactic sugar for several kinds of lists
+ * @alias for_each_page_in_list
+ * @description Syntactic sugar for several kinds of lists.
*
* @param {String} type - list type
* @param {String} [title] - page title if necessary.
@@ -1128,7 +1140,7 @@ function Wikiapi_list(list_type, title, options) {
* @param {Object} [options] - options to run this function.
* @returns {Promise}
*
- * @deprecated Please use Wikiapi_list()
+ * @deprecated Please use {@link Wikiapi_list}.
*
* @example
List all redirected categories
//
@@ -1737,7 +1749,8 @@ function Wikiapi_download(file_title, options) {
/**
* @alias for_each_page
- * @description Edit / process pages listing in page_list. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。
+ * @description Edit / process pages listing in page_list. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。
+ * You might be interested in {@link Wikiapi_list}.
*
* @param {Array} page_list - title list or page_data list
* @param {Function} for_each_page - processor for each page. for_each_page(page_data with contents)
@@ -1925,13 +1938,16 @@ function Wikiapi_run_SQL(SQL, for_each_row/* , options */) {
// --------------------------------------------------------
/**
+ * @alias setup_layout_element_to_insert
+ * @description Setup layout element to insert before insert layout element.
+ *
* @example
insert layout element
//
-layout_element = CeL.wiki.parse('{{Authority control}}');
+const layout_element = CeL.wiki.parse('{{Authority control}}');
await wiki_session.setup_layout_element_to_insert(layout_element);
-page_data = await wiki.page(page_data);
-parsed = page_data.parse();
+const page_data = await wiki.page(page_data);
+const parsed = page_data.parse();
parsed.insert_layout_element(layout_element);
parsed.toString();
//
@@ -2012,14 +2028,14 @@ Wikiapi_get_featured_content.default_types = 'FFA|GA|FA|FL'.split('|');
/**
* @alias site_name
- * @description Get site name / project name of this {Wikiapi}.
+ * @description Get site name / project name of this {@link Wikiapi} instance.
*
* @param {String} [language] - language code of wiki session
* @param {Object} [options] - options to run this function
*
* @returns {String}site name
*
- * @example
Get site name of {Wikiapi}.
+ * @example
Get site name of {@link Wikiapi} instance.
//
console.log(Wikiapi.site_name('zh', { get_all_properties: true }));
@@ -2097,7 +2113,7 @@ Object.assign(Wikiapi.prototype, {
* @description edits content of target page.
* MUST using directly after {@link Wikiapi#page} without any complicated operation! Or rather, the {@link Wikiapi#edit_page} should be used instead.
* Note: for multiple pages, you should use {@link Wikiapi#for_each_page}.
- * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
+ * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
*
* @param {String|Function} content - 'wikitext page content' || page_data => 'wikitext'
* @param {Object} [options] - options to run this function. e.g., { summary: '', bot: 1, nocreate: 1, minor: 1 }
diff --git a/docs/Wikiapi.html b/docs/Wikiapi.html
index 92049bc..0c35700 100644
--- a/docs/Wikiapi.html
+++ b/docs/Wikiapi.html
@@ -27,7 +27,7 @@
edit
- edits content of target page. MUST using directly after Wikiapi#page without any complicated operation! Or rather, the Wikiapi#edit_page should be used instead.
Note: for multiple pages, you should use Wikiapi#for_each_page.
Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
+ edits content of target page. MUST using directly after Wikiapi#page without any complicated operation! Or rather, the Wikiapi#edit_page should be used instead.
Note: for multiple pages, you should use Wikiapi#for_each_page.
Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
edit_page
- edits content of target page.
Note: for multiple pages, you should use Wikiapi#for_each_page.
Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
+ edits content of target page.
Note: for multiple pages, you should use Wikiapi#for_each_page.
Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See mechanism to stop operations.
@@ -2039,7 +2039,7 @@
- Edit / process pages listing in page_list. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。
+ Edit / process pages listing in page_list. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。 You might be interested in Wikiapi_list.
// <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 => {
- // ...
- });
+
// <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 => {
+ // ...
+ });
// </code>
get pages transcluding {{w:en:Periodic table}}
-
// <code>
-const wiki = new Wikiapi;
-let page_list = await wiki.embeddedin('Template:Periodic table');
-console.log(page_list);
+
// <code>
+const wiki = new Wikiapi;
+let page_list = await wiki.embeddedin('Template:Periodic table');
+console.log(page_list);
// </code>
Process each page of the category.
-
// <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);
- }
-});
+
// <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);
+ }
+});
// </code>
/**
* @alias page
- * @description given a title, returns the page's data.
+ * @description Given a title, returns the page's data.
*
* @param {String} title - page title
* @param {Object} [options] - options to run this function
@@ -422,6 +430,7 @@
wikiapi.js
*
* @returns {Boolean} Return <code>true</code> if the edit operation failed.
*
+ * @ignore
* @inner
*/
function reject_edit_error(reject, error, result) {
@@ -455,7 +464,7 @@
wikiapi.js
* @alias edit_page
* @description edits content of target page.<br />
* Note: for multiple pages, you should use {@link Wikiapi#for_each_page}.<br />
- * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See <a href="https://zh.wikipedia.org/wiki/User:Cewbot/Stop">mechanism to stop operations</a>.
+ * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See <a href="https://en.wikipedia.org/wiki/User:Cewbot/Stop">mechanism to stop operations</a>.
*
* @param {String} title - page title
* @param {String|Function} content - 'wikitext page content' || page_data => 'wikitext'
@@ -782,6 +791,7 @@
*
* @returns {Promise} Promise object represents {Object} result data entity
*
+ * @ignore
* @inner
*/
function modify_data_entity(data_to_modify, options) {
@@ -1164,7 +1175,8 @@
wikiapi.js
/**
- * Syntactic sugar for several kinds of lists
+ * @alias for_each_page_in_list
+ * @description Syntactic sugar for several kinds of lists.
*
* @param {String} type - list type
* @param {String} [title] - page title if necessary.
@@ -1172,7 +1184,7 @@
wikiapi.js
* @param {Object} [options] - options to run this function.
* @returns {Promise}
*
- * @deprecated Please use <a href="#Wikiapi_list">Wikiapi_list()</a>
+ * @deprecated Please use {@link Wikiapi_list}.
*
* @example <caption>List all redirected categories</caption>
// <code>
@@ -1781,7 +1793,8 @@
wikiapi.js
/**
* @alias for_each_page
- * @description Edit / process pages listing in <code>page_list</code>. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。
+ * @description Edit / process pages listing in <code>page_list</code>. Will get the content of multiple pages at once to save transmission times. 一次取得多個頁面內容,以節省傳輸次數。<br />
+ * <b>You might be interested in {@link Wikiapi_list}</b>.
*
* @param {Array} page_list - title list or page_data list
* @param {Function} for_each_page - processor for each page. for_each_page(page_data with contents)
@@ -1969,13 +1982,16 @@
/**
* @alias site_name
- * @description Get site name / project name of this {Wikiapi}.
+ * @description Get site name / project name of this {@link Wikiapi} instance.
*
* @param {String} [language] - language code of wiki session
* @param {Object} [options] - options to run this function
*
* @returns {String}site name
*
- * @example <caption>Get site name of {Wikiapi}.</caption>
+ * @example <caption>Get site name of {@link Wikiapi} instance.</caption>
// <code>
console.log(Wikiapi.site_name('zh', { get_all_properties: true }));
@@ -2141,7 +2157,7 @@
wikiapi.js
* @description edits content of target page.<br />
* <em>MUST using directly after {@link Wikiapi#page} without any complicated operation! Or rather, the {@link Wikiapi#edit_page} should be used instead.</em><br />
* Note: for multiple pages, you should use {@link Wikiapi#for_each_page}.<br />
- * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See <a href="https://zh.wikipedia.org/wiki/User:Cewbot/Stop">mechanism to stop operations</a>.
+ * Note: The function will check sections of [[User talk:user name/Stop]] if somebody tells us needed to stop edit. See <a href="https://en.wikipedia.org/wiki/User:Cewbot/Stop">mechanism to stop operations</a>.
*
* @param {String|Function} content - 'wikitext page content' || page_data => 'wikitext'
* @param {Object} [options] - options to run this function. e.g., { summary: '', bot: 1, nocreate: 1, minor: 1 }
@@ -2246,7 +2262,7 @@