TableOfContentsGenerator
in package
implements
TableOfContentsGeneratorInterface
Interfaces, Classes and Traits
Table of Contents
- NORMALIZE_DISABLED = 'as-is'
- NORMALIZE_FLAT = 'flat'
- NORMALIZE_RELATIVE = 'relative'
- STYLE_BULLET = LeagueCommonMarkBlockElementListBlock::TYPE_BULLET
- STYLE_ORDERED = LeagueCommonMarkBlockElementListBlock::TYPE_ORDERED
- $maxHeadingLevel : int
- $minHeadingLevel : int
- $normalizationStrategy : string
- $style : string
- __construct() : mixed
- generate() : TableOfContents|null
- createToc() : TableOfContents
- getHeadingLinks() : iteratable<string|int, HeadingPermalink>
- getHeadingText() : string
- getNormalizer() : NormalizerStrategyInterface
Constants
NORMALIZE_DISABLED
public
mixed
NORMALIZE_DISABLED
= 'as-is'
NORMALIZE_FLAT
public
mixed
NORMALIZE_FLAT
= 'flat'
NORMALIZE_RELATIVE
public
mixed
NORMALIZE_RELATIVE
= 'relative'
STYLE_BULLET
public
mixed
STYLE_BULLET
= LeagueCommonMarkBlockElementListBlock::TYPE_BULLET
STYLE_ORDERED
public
mixed
STYLE_ORDERED
= LeagueCommonMarkBlockElementListBlock::TYPE_ORDERED
Properties
$maxHeadingLevel
private
int
$maxHeadingLevel
$minHeadingLevel
private
int
$minHeadingLevel
$normalizationStrategy
private
string
$normalizationStrategy
$style
private
string
$style
Methods
__construct()
public
__construct(string $style, string $normalizationStrategy, int $minHeadingLevel, int $maxHeadingLevel) : mixed
Parameters
- $style : string
- $normalizationStrategy : string
- $minHeadingLevel : int
- $maxHeadingLevel : int
Return values
mixed —generate()
public
generate(Document $document) : TableOfContents|null
Parameters
- $document : Document
Return values
TableOfContents|null —createToc()
private
createToc(Document $document) : TableOfContents
Parameters
- $document : Document
Return values
TableOfContents —getHeadingLinks()
private
getHeadingLinks(Document $document) : iteratable<string|int, HeadingPermalink>
Parameters
- $document : Document
Return values
iteratable<string|int, HeadingPermalink> —getHeadingText()
private
static getHeadingText(Heading $heading) : string
Parameters
- $heading : Heading
Return values
string —getNormalizer()
private
getNormalizer(TableOfContents $toc) : NormalizerStrategyInterface
Parameters
- $toc : TableOfContents