ExtensionDocMarker
final class ExtensionDocMarker (View source)
An HTML comment that shows where the content of an extension doc starts in the markdown for a doc.
The index in the marker is the index of the extension doc in the list of extensions for the doc.
Constants
| PATTERN |
Matches a marker from getMarker() |
Methods
Get the marker to put in the markdown before the content of an extension doc.
Get the extension index if this node is only a marker.
Log a warning for each marker that is part of other content, because then the content of that extension doc can't be found.
Remove all markers from the parsed document, so they aren't rendered.
Details
static string
getMarker(string|int $index)
Get the marker to put in the markdown before the content of an extension doc.
static string|null
getIndex(Node $node)
Get the extension index if this node is only a marker.
static void
warnAboutHiddenMarkers(DocumentParsedEvent $event, array $extensionData = [])
Log a warning for each marker that is part of other content, because then the content of that extension doc can't be found.
Use this from a listener that runs before any listener that moves or removes content, so that every marker is checked.
static void
removeMarkers(DocumentParsedEvent $event)
Remove all markers from the parsed document, so they aren't rendered.
Use this as a listener that runs after all listeners that use the markers.