new ParsoidConfig(localSettings, options)
Global Parsoid configuration object. Will hold things like debug/trace options, mw api map, and local settings like fetchTemplates.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
localSettings |
Object | The localSettings object, probably from a localsettings.js file. Properties
|
||||||||||||
options |
Object | Any options we want to set over the defaults. See the class properties for more information. |
- Source:
Members
addHTMLTemplateParameters
Properties:
Name | Type | Description |
---|---|---|
addHTMLTemplateParameters |
boolean | When processing template parameters, parse them to HTML and add it to the template parameters data. |
- Source:
allowCORS
Properties:
Name | Type | Description |
---|---|---|
allowCORS |
string | Permissive CORS headers as Parsoid is full idempotent currently |
- Source:
batchConcurrency
The maximum number of concurrent requests that the API request batcher will allow to be active at any given time.
The maximum number of concurrent requests that the API request batcher will allow to be active at any given time. Before this limit is reached, requests will be dispatched more aggressively, giving smaller batches on average. After the limit is reached, batches will be stored in a queue with APIBatchSize items in each batch.
- Source:
batchSize
The batch size for parse/preprocess requests
.The batch size for parse/preprocess requests
- Source:
debug
Properties:
Name | Type | Description |
---|---|---|
debug |
boolean | Whether to print debugging information. |
- Source:
debugFlags
Properties:
Name | Type | Description |
---|---|---|
debugFlags |
Set | Flags that tell us which debugging information to print. |
- Source:
defaultAPIProxyURI
The default api proxy, overridden by apiConf.proxy entries.
- Source:
defaultWiki
Properties:
Name | Type | Description |
---|---|---|
defaultWiki |
string | The wiki we should use for template, page, and configuration requests. We set this as a default because a configuration file (e.g. the API service's config.yaml) might set this, but we will still use the appropriate wiki when requests come in for a different prefix. |
- Source:
devAPI
Properties:
Name | Type | Description |
---|---|---|
Expose |
boolean | development routes in the HTTP API. |
- Source:
dumpFlags
dynamicConfig
Properties:
Name | Type | Description |
---|---|---|
Allow |
function
|
null
|
dynamic configuration of unknown domains. See T100841. |
- Source:
expandExtensions
Properties:
Name | Type | Description |
---|---|---|
expandExtensions |
boolean | Whether we should request extension tag expansions from a wiki. |
- Source:
fetchConfig
Properties:
Name | Type | Description |
---|---|---|
fetchConfig |
boolean | Whether to fetch the wiki config from the server or use our local copy. |
- Source:
fetchImageInfo
Properties:
Name | Type | Description |
---|---|---|
fetchImageInfo |
boolean | Whether to fetch image info via the API or else treat all images as missing. |
- Source:
fetchTemplates
Properties:
Name | Type | Description |
---|---|---|
fetchTemplates |
boolean | Whether we should request templates from a wiki, or just use cached versions. |
- Source:
heapUsageSampleInterval
Properties:
Name | Type | Description |
---|---|---|
How |
number | often should we emit a heap sample? Time in ms. Only relevant if performance timing is enabled |
- Source:
linting
Properties:
Name | Type | Description |
---|---|---|
linting |
boolean | Array | Whether to enable linter Backend. Or an array of enabled lint types |
- Source:
loadWMF
Load WMF sites in the interwikiMap from the cached wmf.sitematrix.json
.Load WMF sites in the interwikiMap from the cached wmf.sitematrix.json
- Source:
loggerBackend
Properties:
Name | Type | Description |
---|---|---|
loggerBackend |
function | The logger output function. By default, use stderr to output logs. |
- Source:
loggerSampling
Properties:
Name | Type | Description |
---|---|---|
loggerSampling |
Array
|
null
|
An array of arrays of log types and sample rates, in percent. Omissions imply 100. For example, parsoidConfig.loggerSampling = [ ['warn/dsr/inconsistent', 1], ]; |
- Source:
logMwApiWarnings
Log warnings from the Mediawiki Api.
- Source:
maxDepth
Properties:
Name | Type | Description |
---|---|---|
maxDepth |
number | The maximum depth to which we should expand templates. Only applies if we would fetch templates anyway, and if we're actually expanding templates. So #fetchTemplates must be true and #usePHPPreProcessor must be false. |
- Source:
maxFormSize
Properties:
Name | Type | Description |
---|---|---|
Form |
number | size limit in bytes (default is 2M in express) |
- Source:
maxListeners
Properties:
Name | Type | Description |
---|---|---|
Number |
number | of outstanding event listeners waiting on Mediawiki API responses |
- Source:
metrics
Properties:
Name | Type | Description |
---|---|---|
Statistics |
Object
|
null
|
aggregator, for counting and timing. |
- Source:
modulesLoadURI
The server from which to load style modules.
- Source:
mwApiServer
Server to connect to for MediaWiki API requests.
- Source:
nativeGallery
Properties:
Name | Type | Description |
---|---|---|
Enable |
boolean | editing galleries via HTML, instead of extsrc. |
- Source:
rtTestMode
Properties:
Name | Type | Description |
---|---|---|
rtTestMode |
boolean | Test in rt test mode (changes some parse & serialization strategies) |
- Source:
scrubBidiChars
If enabled, bidi chars adjacent to category links will be stripped in the html -> wt serialization pass.
If enabled, bidi chars adjacent to category links will be stripped in the html -> wt serialization pass.
- Source:
strictSSL
Properties:
Name | Type | Description |
---|---|---|
strictSSL |
boolean | By default require SSL certificates to be valid Set to false when using self-signed SSL certificates |
- Source:
suppressMwApiWarnings
Suppress some warnings by default.
- Source:
traceFlags
Properties:
Name | Type | Description |
---|---|---|
traceFlags |
Set | Flags that tell us which tracing information to print. |
- Source:
tracerBackend
Properties:
Name | Type | Description |
---|---|---|
tracerBackend |
function | The tracer output function. By default, use stderr to output traces. |
- Source:
useBatchAPI
Set to true to use the Parsoid-specific batch API from the ParsoidBatchAPI extension (action=parsoid-batch).
Set to true to use the Parsoid-specific batch API from the ParsoidBatchAPI extension (action=parsoid-batch).
- Source:
usePHPPreProcessor
Properties:
Name | Type | Description |
---|---|---|
usePHPPreProcessor |
boolean | Whether we should use the PHP Preprocessor to expand templates, extension content, and the like. See #PHPPreProcessorRequest in lib/mediawiki.ApiRequest.js |
- Source:
userAgent
Properties:
Name | Type | Description |
---|---|---|
Default |
string | user agent used for making Mediawiki API requests |
- Source:
useSelser
Properties:
Name | Type | Description |
---|---|---|
useSelser |
boolean | Whether to use selective serialization when serializing a DOM to Wikitext. This amounts to not serializing bits of the page that aren't marked as having changed, and requires some way of getting the original text of the page. See #SelectiveSerializer in lib/mediawiki.SelectiveSerializer.js |
- Source:
Methods
getAPIProxy(prefix) → {Object}
Figure out the proxy to use for API requests for a given wiki.
Parameters:
Name | Type | Description |
---|---|---|
prefix |
string |
- Source:
Returns:
- Type
- Object
getPrefixFor(domain) → {string}
Return the internal prefix used to index configuration information for the given domain string.
Return the internal prefix used to index configuration information for
the given domain string. If the prefix is not present, attempts
dynamic configuration using the dynamicConfig
hook before returning.
XXX: We should eventually move the dynamic configuration to lookups on
the mwApiMap, once we remove prefix
from our codebase: T206764.
Parameters:
Name | Type | Description |
---|---|---|
domain |
string |
- Source:
Returns:
Internal prefix
- Type
- string
loadWMFApiMap()
Initialize the mwApiMap and friends.
- Source:
removeMwApi(apiConf)
Remove an wiki configuration.
Parameters:
Name | Type | Description |
---|---|---|
apiConf |
Object | A wiki configuration object. The value of |
- Source:
setMwApi(apiConf)
Set up a wiki configuration.
For backward compatibility, if there are two arguments the first is
taken as a prefix and the second as the configuration, and if
the configuration is a string it is used as the uri
property
in a new empty configuration object. This usage is deprecated;
we recommend users pass a configuration object as documented below.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apiConf |
Object | The wiki configuration object. Properties
|
- Source: