\rex_markdown

Markdown parser.

Summary

Methods
Properties
Constants
setFactoryClass()
getFactoryClass()
hasFactoryClass()
factory()
parse()
parseWithToc()
No public properties found
No constants found
callFactoryClass()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

setFactoryClass()

setFactoryClass(string  $subclass) : mixed

Sets the class for the factory.

Parameters

string $subclass

Classname

Throws

\InvalidArgumentException

Returns

mixed —

getFactoryClass()

getFactoryClass() : string

Returns the class for the factory.

Returns

string —

hasFactoryClass()

hasFactoryClass() : bool

Returns if the class has a custom factory class.

Returns

bool —

factory()

factory() : static

Returns

static —

parse()

parse(string  $code, bool  $softLineBreaks = true) : string

Parses markdown code.

Parameters

string $code

Markdown code

bool $softLineBreaks

Returns

string —

HTML code

parseWithToc()

parseWithToc(string  $code, int  $topLevel = 2, int  $bottomLevel = 3, bool  $softLineBreaks = true) : array

Parses markdown code and extracts a table-of-content.

Parameters

string $code

Markdown code

int $topLevel

Top included headline level for TOC, e.g. 1 for <h1>

int $bottomLevel

Bottom included headline level for TOC, e.g. 6 for <h6>

bool $softLineBreaks

Returns

array —

tupel of table-of-content and content

callFactoryClass()

callFactoryClass(string  $method, array  $arguments) : mixed

Calls the factory class with the given method and arguments.

Parameters

string $method

Method name

array $arguments

Array of arguments

Returns

mixed —

Result of the callback