Constructor
new Page(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Configuration options Properties
|
- Source:
Methods
(static) parse(resp) → {Page}
Create a Page object from an API response.
Parameters:
Name | Type | Description |
---|---|---|
resp |
Object | as representing a page in the API |
Returns:
- Type
- Page
getDisplayTitle() → {string}
Retrieve the title that should be displayed to the user
- Source:
Returns:
HTML
- Type
- string
getNamespaceId() → {number}
return namespace id
- Source:
Returns:
namespace Number
- Type
- number
getRevisionId() → {number}
Return the latest revision id for this page
- Source:
Returns:
- Type
- number
getSection(id) → {Section}
FIXME: Change function signature to take the anchor of the heading
Parameters:
Name | Type | Description |
---|---|---|
id |
string | of the section as defined by MobileFormatter. Note, that currently, this is different from the PHP parser in that it relates to top-level sections. For example, mf-section-1 would relate to section 1. See FIXME. |
- Source:
Returns:
- Type
- Section
getSections() → {Array}
Obtain the list of high level (and grouped) sections. Note that this list will not include subsections.
- Source:
Returns:
of Section instances
- Type
- Array
getTitle() → {string}
Return prefixed page title
- Source:
Returns:
- Type
- string
inNamespace(namespace) → {boolean}
Determine if current page is in a specified namespace
Parameters:
Name | Type | Description |
---|---|---|
namespace |
string | Name of namespace |
- Source:
Returns:
- Type
- boolean
isMainPage() → {boolean}
Checks whether the current page is the main page
- Source:
Returns:
- Type
- boolean
isWatched() → {boolean}
Checks whether the current page is watched
- Source:
Returns:
- Type
- boolean
isWikiText() → {boolean}
Determines if content model is wikitext
- Source:
Returns:
- Type
- boolean