Parsoid
A bidirectional parser between wikitext and HTML5
|
An Env accessing MediaWiki via its Action API. More...
Public Member Functions | |
__construct (array $opts) | |
getSiteConfig () | |
Public Member Functions inherited from Wikimedia\Parsoid\Config\Env | |
__construct (SiteConfig $siteConfig, PageConfig $pageConfig, DataAccess $dataAccess, ContentMetadataCollector $metadata, ?array $options=null) | |
profiling () | |
Is profiling enabled? | |
getCurrentProfile () | |
Get the profile at the top of the stack. | |
pushNewProfile () | |
New pipeline started. | |
popProfile () | |
Pipeline ended. | |
hasTraceFlags () | |
hasTraceFlag (string $flag) | |
Test which trace information to log. | |
hasDumpFlags () | |
hasDumpFlag (string $flag) | |
Test which state to dump. | |
writeDump (string $str) | |
Write out a string (because it was requested by dumpFlags) | |
getPageConfig () | |
Get the page config. | |
getDataAccess () | |
Get the data access object. | |
getMetadata () | |
Return the ContentMetadataCollector. | |
nativeTemplateExpansionEnabled () | |
getUID () | |
Get the current uid counter value. | |
getFID () | |
Get the current fragment id counter value. | |
getWrapSections () | |
Whether <section> wrappers should be added. | |
getPipelineFactory () | |
Get the pipeline factory. | |
getRequestOffsetType () | |
Return the external format of character offsets in source ranges. | |
getCurrentOffsetType () | |
Return the current format of character offsets in source ranges. | |
setCurrentOffsetType (string $offsetType) | |
Update the current offset type. | |
resolveTitle (string $str, bool $resolveOnly=false) | |
Resolve strings that are page-fragments or subpage references with respect to the current page name. | |
normalizedTitleKey (string $str, bool $noExceptions=false, bool $ignoreFragment=false) | |
Get normalized title key for a title string. | |
makeTitleFromText (string $str, $defaultNs=0, bool $noExceptions=false) | |
Create a Title object. | |
makeTitleFromURLDecodedStr (string $str, $defaultNs=0, bool $noExceptions=false) | |
Create a Title object. | |
makeLink (Title $title) | |
Make a link to a Title. | |
isValidLinkTarget ( $href) | |
Test if an href attribute value could be a valid link target. | |
generateUID () | |
Generate a new uid. | |
newObjectId () | |
Generate a new object id. | |
generateAnnotationUID () | |
Generate a new annotation uid. | |
newAnnotationId () | |
Generate a new annotation id. | |
newAboutId () | |
Generate a new about id. | |
setDOMDiff ( $doc) | |
Store reference to DOM diff document. | |
getDOMDiff () | |
Return reference to DOM diff document. | |
newFragmentId () | |
Generate a new fragment id. | |
setupTopLevelDoc (?Document $topLevelDoc=null) | |
When an environment is constructed, we initialize a document (and RemexPipeline) to be used throughout the parse. | |
fetchRemexPipeline (bool $atTopLevel) | |
setVariable (string $variable, $state) | |
BehaviorSwitchHandler support function that adds a property named by $variable and sets it to $state. | |
setBehaviorSwitch (string $switch, $state) | |
Record a behavior switch. | |
getBehaviorSwitch (string $switch, $default=null) | |
Fetch the state of a previously-recorded behavior switch. | |
getDOMFragmentMap () | |
getDOMFragment (string $id) | |
setDOMFragment (string $id, DocumentFragment $forest) | |
removeDOMFragment (string $id) | |
recordLint (string $type, array $lintData) | |
Record a lint. | |
getLints () | |
Retrieve recorded lints. | |
setLints (array $lints) | |
Init lints to the passed array. | |
log (... $args) | |
bumpWt2HtmlResourceUse (string $resource, int $count=1) | |
Bump usage of some limited parser resource (ex: tokens, # transclusions, # list items, etc.) | |
compareWt2HtmlLimit (string $resource, int $n) | |
bumpHtml2WtResourceUse (string $resource, int $count=1) | |
Bump usage of some limited serializer resource (ex: html size) | |
getContentHandler (?string &$contentmodel=null) | |
Get an appropriate content handler, given a contentmodel. | |
langConverterEnabled () | |
Is the language converter enabled on this page? | |
getInputContentVersion () | |
The HTML content version of the input document (for html2wt and html2html conversions). | |
getOutputContentVersion () | |
The HTML content version of the input document (for html2wt and html2html conversions). | |
getHtmlVariantLanguage () | |
If non-null, the language variant used for Parsoid HTML; we convert to this if wt2html, or from this (if html2wt). | |
getWtVariantLanguage () | |
If non-null, the language variant to be used for wikitext. | |
htmlVary () | |
Determine appropriate vary headers for the HTML form of this page. | |
htmlContentLanguage () | |
Determine an appropriate content-language for the HTML form of this page. | |
Additional Inherited Members | |
Public Attributes inherited from Wikimedia\Parsoid\Config\Env | |
$topFrame | |
$logLinterData = false | |
$styleTagKeys = [] | |
$pageBundle = false | |
$discardDataParsoid = false | |
$hasAnnotations | |
$pageCache = [] | |
$transclusionCache = [] | |
$mediaCache = [] | |
$extensionCache = [] | |
$topLevelDoc | |
An Env accessing MediaWiki via its Action API.
Note this is intended for testing, not performance.
Wikimedia\Parsoid\Config\Api\Env::__construct | ( | array | $opts | ) |
array | $opts | In addition to those from the parent class,
|
Wikimedia\Parsoid\Config\Api\Env::getSiteConfig | ( | ) |
Reimplemented from Wikimedia\Parsoid\Config\Env.