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 @@
@@ -71,7 +71,7 @@

new WikiapiSource:
@@ -237,7 +237,7 @@

(static) <
Source:
@@ -307,7 +307,7 @@

(static) sk
Source:
@@ -380,7 +380,7 @@

category
Source:
@@ -600,7 +600,7 @@

conver
Source:
@@ -819,7 +819,7 @@

dataSource:
@@ -1084,7 +1084,7 @@

deleteSource:
@@ -1296,7 +1296,7 @@

downloadSource:
@@ -1551,7 +1551,7 @@

editSource:
@@ -1591,7 +1591,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.

@@ -1755,7 +1755,7 @@

edit_pageSource:
@@ -1795,7 +1795,7 @@

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 @@

for_each
Source:
@@ -2079,7 +2079,7 @@

for_each
- 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.
@@ -2318,7 +2318,7 @@

listenSource:
@@ -2546,7 +2546,7 @@

listen - Listen to page modification. 監視最近更改的頁面。
wrapper for wiki_API#listen + Listen to page modification. 監視最近更改的頁面。
wrapper for wiki_API#listen @@ -2707,7 +2707,7 @@

loginSource:
@@ -2964,7 +2964,7 @@

move_pageSource:
@@ -3211,7 +3211,7 @@

move_toSource:
@@ -3425,7 +3425,7 @@

new_da
Source:
@@ -3635,7 +3635,7 @@

pageSource:
@@ -3675,7 +3675,7 @@

page - given a title, returns the page's data. + Given a title, returns the page's data. @@ -3902,7 +3902,7 @@

purgeSource:
@@ -4113,7 +4113,7 @@

querySource:
@@ -4328,7 +4328,7 @@

redirec
Source:
@@ -4538,7 +4538,7 @@

redirec
Source:
@@ -4748,7 +4748,7 @@

reg
Source:
@@ -5004,7 +5004,7 @@