class Item implements ItemInterface, Stringable

The TOC Item class represents

Methods

__construct(MarkdownString $markdown)

Constructor

string
getTitle()

Get the title of the navigation item

string|null
getLink()

Get the link of the navigation item

ItemEnum
getType()

Get the type of the navigation item

int
getDepth(string|null $indent = ' ', string|null $symbol = '-', int|null $depth = 0, int|null $initialHCount = 0, int|null $initialIndentCount = 0)

Get the depth of the navigation item

string
toHtml()

Get the HTML of the given markdown string

string
__toString()

Implement Stringable

static Item
of(string $markdown)

Factory

Details

at line 20
protected __construct(MarkdownString $markdown)

Constructor

Parameters

MarkdownString $markdown

The Markdown string

at line 29
string getTitle()

Get the title of the navigation item

Return Value

string

The method returns the title of the navigation item

Get the link of the navigation item

Return Value

string|null

The method returns the link of the navigation item

at line 64
ItemEnum getType()

Get the type of the navigation item

Return Value

ItemEnum

The method returns the type of the navigation item

at line 74
int getDepth(string|null $indent = ' ', string|null $symbol = '-', int|null $depth = 0, int|null $initialHCount = 0, int|null $initialIndentCount = 0)

Get the depth of the navigation item

Parameters

string|null $indent

The indent e.g. "-" or "*"

string|null $symbol

The symbol e.g. "-" or "*"

int|null $depth

The depth e.g. 1, 2, 3, 4

int|null $initialHCount

The initial # count

int|null $initialIndentCount

The initial indent count

Return Value

int

The method returns the depth of the navigation item

Exceptions

InvalidArgumentException

at line 118
string toHtml()

Get the HTML of the given markdown string

Return Value

string

The method returns the HTML of the given markdown string

at line 146
string __toString()

Implement Stringable

Return Value

string

at line 156
static Item of(string $markdown)

Factory

Parameters

string $markdown

The markdown string

Return Value

Item