Skip to content

Commit

Permalink
fix markdown syntax to makes links visible on npm
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Aug 29, 2021
1 parent 04e2b23 commit 776adf9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,36 @@ To install, run `npm install mwn`.
[![Download stats](https://nodei.co/npm/mwn.png?downloads=true&downloadRank=true)](https://nodei.co/npm/mwn/)

### Documentation
Up-to-date documentation is [**hosted on Toolforge**](https://mwn.toolforge.org/).

API documentation (automatically generated via [typedoc](https://npmjs.com/package/typedoc)) is also available at https://mwn.toolforge.org/docs/api.
Up-to-date documentation is **[hosted on Toolforge](https://mwn.toolforge.org/)**.

API documentation (automatically generated via [typedoc](https://npmjs.com/package/typedoc)) is also available at <https://mwn.toolforge.org/docs/api>.

### Features

- **Handling multiple users and wikis**: Mwn can seamlessly work with multiple bot users signed into the same wiki, and multiple wikis at the same time. You just have to create multiple bot instances – each one representing a wiki + user. Each bot instance uses an isolated cookie jar; all settings are also isolated.

- **Token handling**: [Tokens](https://www.mediawiki.org/wiki/API:Tokens) are automatically fetched as part of `mwn.init()` or `bot.login()` or `bot.getTokensAndSiteInfo()`. Once retrieved, they are stored in the bot state and can be reused any number of times. If any API request fails due to an expired or missing token, the request is automatically retried after fetching a new token. `bot.getTokens()` can be used to refresh the token cache, though mwn manages this, so you'd never need to explicitly use that.

- **Maxlag**: The default [maxlag parameter](https://www.mediawiki.org/wiki/Manual:Maxlag_parameter) used by mwn is 5 seconds. Requests failing due to maxlag will be automatically retried after pausing for a duration specified by `maxlagPause` (default 5 seconds). A maximum of `maxRetries` will take place (default 3).

- **Retries**: Mwn automatically retries failing requests `bot.options.maxRetries` times (default: 3). This is useful in case of connectivity resets and the like. As for errors raised by the API itself, note that MediaWiki generally handles these at the response level rather than the protocol level (they still emit a 200 OK response). Mwn will attempt retries for these errors based on the error code. For instance, if the error is `readonly` or `maxlag` , retry is done after a delay. If it's `assertuserfailed` or `assertbotfailed` (indicates a session loss), mwn will try to log in again and then retry. If it's `badtoken`, retry is done after fetching a fresh edit token.

- **Handling query continuation**: Mwn uses [asynchronous generators](https://javascript.info/async-iterators-generators), ([for await...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) loops) to provide a very intuitive interface around MediaWiki API's [query continuation](https://www.mediawiki.org/wiki/API:Query#Example_4:_Continuing_queries). See [**Handling query continuation**](https://mwn.toolforge.org/docs/handling-query-continuation).
- **Handling query continuation**: Mwn uses [asynchronous generators](https://javascript.info/async-iterators-generators), ([for await...of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) loops) to provide a very intuitive interface around MediaWiki API's [query continuation](https://www.mediawiki.org/wiki/API:Query#Example_4:_Continuing_queries). See **[Handling query continuation](https://mwn.toolforge.org/docs/handling-query-continuation)**.

- [**Parsing wikitext**](https://mwn.toolforge.org/docs/working-with-wikitext): Mwn provides methods for common wikitext parsing needs (templates, links, and simple tables).
- **[Parsing wikitext](https://mwn.toolforge.org/docs/working-with-wikitext)**: Mwn provides methods for common wikitext parsing needs (templates, links, and simple tables).

- [**Titles**](https://mwn.toolforge.org/docs/working-with-titles): Work with page titles with the very same API as the in-browser [mw.Title](https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Title) that userscript/gadget developers are familiar with.
- **[Titles](https://mwn.toolforge.org/docs/working-with-titles)**: Work with page titles with the very same API as the in-browser [mw.Title](https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Title) that userscript/gadget developers are familiar with.

- [**Emergency shutoff**](https://mwn.toolforge.org/docs/emergency-shutoff)
- **[Emergency shutoff](https://mwn.toolforge.org/docs/emergency-shutoff)**

- [**Bot exclusion compliance**](https://mwn.toolforge.org/docs/exclusion-compliance)
- **[Bot exclusion compliance](https://mwn.toolforge.org/docs/exclusion-compliance)**

- [**Batch operations**](https://mwn.toolforge.org/docs/bulk-processing#batch-operations): Perform a large number of tasks (like page edits) with control over the concurrency (default 5). Failing actions can be set to automatically retry.
- **[Batch operations](https://mwn.toolforge.org/docs/bulk-processing#batch-operations)**: Perform a large number of tasks (like page edits) with control over the concurrency (default 5). Failing actions can be set to automatically retry.

### Contributing
Patches are very much welcome. See https://mwn.toolforge.org/docs/developing for instructions.

Patches are very much welcome. See <https://mwn.toolforge.org/docs/developing> for instructions.

### Licensing

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mwn",
"version": "1.11.3",
"version": "1.11.4",
"description": "JavaScript & TypeScript MediaWiki bot framework for Node.js",
"main": "./build/bot.js",
"types": "./build/bot.d.ts",
Expand Down

0 comments on commit 776adf9

Please sign in to comment.