R: Build MediaWiki Page URL

wt_wiki_url_build {wikitaxa} | R Documentation

## Build MediaWiki Page URL

### Description

Builds a MediaWiki page url from its component parts (wiki name, wiki type, and page title). Supports both static page urls and their equivalent API calls.

### Usage

    wt_wiki_url_build(wiki, type = NULL, page = NULL, api = FALSE,
      action = "parse", redirects = TRUE, format = "json", utf8 = TRUE,
      prop = c("text", "langlinks", "categories", "links", "templates", "images",
      "externallinks", "sections", "revid", "displaytitle", "iwlinks",
      "properties"))

### Arguments

`wiki` | (character | list) Either the wiki name or a list with `$wiki`, `$type`, and `$page` (the output of `wt_wiki_url_parse()`).
`type` | (character) Wiki type.
`page` | (character) Wiki page title.
`api` | (boolean) Whether to return an API call or a static page url (default). If `FALSE`, all following (API-only) arguments are ignored.
`action` | (character) See https://en.wikipedia.org/w/api.php for supported actions. This function currently only supports "parse".
`redirects` | (boolean) If the requested page is set to a redirect, resolve it.
`format` | (character) See https://en.wikipedia.org/w/api.php for supported output formats.
`utf8` | (boolean) If `TRUE`, encodes most (but not all) non-ASCII characters as UTF-8 instead of replacing them with hexadecimal escape sequences.
`prop` | (character) Properties to retrieve, either as a character vector or pipe-delimited string. See https://en.wikipedia.org/w/api.php?action=help&modules=parse for supported properties.

### Value

a URL (character)

### See Also

Other MediaWiki functions: `wt_wiki_page_parse`, `wt_wiki_page`, `wt_wiki_url_parse`

### Examples

    wt_wiki_url_build(wiki = "en", type = "wikipedia", page = "Malus domestica")
    wt_wiki_url_build(
      wt_wiki_url_parse("https://en.wikipedia.org/wiki/Malus_domestica"))
    wt_wiki_url_build("en", "wikipedia", "Malus domestica", api = TRUE)

[Package wikitaxa version 0.2.0 Index]