Parsoid
A bidirectional parser between wikitext and HTML5
|
MediaWiki data access abstract class for Parsoid. More...
Public Member Functions | |
__construct () | |
Base constructor. | |
getPageInfo ( $pageConfigOrTitle, array $titles) | |
Return target data for formatting links. | |
getFileInfo (PageConfig $pageConfig, array $files) | |
Return information about files (images) | |
parseWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext) | |
Perform a parse on wikitext. | |
preprocessWikitext (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $wikitext) | |
Preprocess wikitext. | |
fetchTemplateSource (PageConfig $pageConfig, LinkTarget $title) | |
Fetch latest revision of article/template content for transclusion. | |
fetchTemplateData (PageConfig $pageConfig, LinkTarget $title) | |
Fetch templatedata for a title. | |
logLinterData (PageConfig $pageConfig, array $lints) | |
Log linter data. | |
addTrackingCategory (PageConfig $pageConfig, ContentMetadataCollector $metadata, string $key) | |
Add a tracking category with the given key to the metadata for the page. | |
MediaWiki data access abstract class for Parsoid.
Wikimedia\Parsoid\Config\DataAccess::__construct | ( | ) |
Base constructor.
This constructor is public because it is used to create mock objects in our test suite.
|
abstract |
Add a tracking category with the given key to the metadata for the page.
PageConfig | $pageConfig | the page on which the tracking category is to be added |
ContentMetadataCollector | $metadata | The metadata for the page |
string | $key | Message key (not localized) |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Fetch templatedata for a title.
This replaces TemplateDataRequest
PageConfig | $pageConfig | |
LinkTarget | $title |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Fetch latest revision of article/template content for transclusion.
Technically, the ParserOptions might select a different revision other than the latest via ParserOptions::getTemplateCallback() (used for FlaggedRevisions, etc), but the point is that template lookups are by title, not revision id.
This replaces TemplateRequest
PageConfig | $pageConfig | |
LinkTarget | $title | Title of the page to fetch |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Return information about files (images)
This replaces ImageInfoRequest and Batcher.imageinfo()
PageConfig | $pageConfig | |
array | $files | [ [string Name, array Dims] ]. The array may contain
|
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Return target data for formatting links.
Replaces Batcher.getPageProps()
PageConfig | LinkTarget | $pageConfigOrTitle | Either a PageConfig or else just the context title from the PageConfig (as a LinkTarget) |
string[] | $titles |
Reimplemented in Wikimedia\Parsoid\Config\Api\DataAccess, and Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Log linter data.
PageConfig | $pageConfig | |
array | $lints |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Perform a parse on wikitext.
This replaces PHPParseRequest with onlypst = false, and Batcher.parse()
PageConfig | $pageConfig | |
ContentMetadataCollector | $metadata | Will collect metadata about the parsed content. |
string | $wikitext |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.
|
abstract |
Preprocess wikitext.
This replaces PreprocessorRequest and Batcher.preprocess()
PageConfig | $pageConfig | |
ContentMetadataCollector | $metadata | Will collect metadata about the preprocessed content. |
string | $wikitext |
Reimplemented in Wikimedia\Parsoid\Mocks\MockDataAccess.