64 public function addRowWrapper(
string $format,
string $diffText ): string;
75 public function render(
string $oldText,
string $newText,
string $format ): string;
86 public function renderBatch(
string $oldText,
string $newText, array $formats ): array;
119 public function localize(
string $format,
string $diff, array $options = [] ): string;
This is one of the Core classes and should be read at least once by any new developers.
An interface for parts of a diff page view which represent changes to text.
renderBatch(string $oldText, string $newText, array $formats)
Render a diff in multiple formats.
getFormatContext(string $format)
Get the context for a given format.
getTablePrefixes(string $format)
Get table prefixes for the specified format.
const CONTEXT_PLAIN
The HTML returned is an ordinary block.
getFormats()
Get the supported format names.
hasFormat(string $format)
Determine whether we support the specified format.
getName()
Get a stable unique name to identify this differ in a cache key.
const CONTEXT_ROW
The HTML returned is zero or more table rows.
addModules(OutputPage $out, string $format)
Modify the OutputPage, adding any headers required by the specified format.
addRowWrapper(string $format, string $diffText)
Make the context consistent by adding a colspan=4 wrapper around plain HTML output.
getPreferredFormatBatch(string $format)
Given a format, get a list of formats which can be generated at the same time with minimal additional...
render(string $oldText, string $newText, string $format)
Generate a diff comparing $oldText with $newText.
const CONTEXT_PRE
The return value is plain text and should be wrapped in a.
localize(string $format, string $diff, array $options=[])
Expand messages in the diff text using the current MessageLocalizer.
getCacheKeys(array $formats)
Get additional cache keys required by the specified formats.