API Documentation

MarkdownService
in package
uses SetsUpMarkdownConverter

Dynamically creates a Markdown converter tailored for the target model and setup, then converts the Markdown to HTML using both pre- and post-processors.

Table of Contents

Properties

$config  : array<string|int, mixed>
$converter  : MarkdownConverter
$extensions  : array<string|int, ExtensionInterface>>
$features  : array<string|int, mixed>
$html  : string
$markdown  : string
$pageClass  : string|null
$postprocessors  : array<string|int, MarkdownPostProcessorContract>>
$preprocessors  : array<string|int, MarkdownPreProcessorContract>>

Methods

__construct()  : mixed
addExtension()  : void
addFeature()  : static
canEnablePermalinks()  : bool
canEnableTorchlight()  : bool
getExtensions()  : array<string|int, mixed>
hasFeature()  : bool
isDocumentationPage()  : bool
normalizeIndentationLevel()  : string
Normalize indentation for an un-compiled Markdown string.
parse()  : string
removeFeature()  : static
withPermalinks()  : static
withTableOfContents()  : static
configurePermalinksExtension()  : void
determineIfTorchlightAttributionShouldBeInjected()  : bool
enableAllHtmlElements()  : void
findLineContentPositions()  : array<int, int>
Find the indentation level and position of the first line that has content.
getNormalizedLines()  : array<int, string>
injectTorchlightAttribution()  : string
runPostProcessing()  : void
runPreProcessing()  : void
setupConverter()  : void

Properties

$extensions

protected array<string|int, ExtensionInterface>> $extensions = []

$postprocessors

protected array<string|int, MarkdownPostProcessorContract>> $postprocessors = []

$preprocessors

protected array<string|int, MarkdownPreProcessorContract>> $preprocessors = []

Methods

__construct()

public __construct(string $markdown[, string|null $pageClass = null ]) : mixed
Parameters
$markdown : string
$pageClass : string|null = null

addExtension()

public addExtension(string $extensionClassName) : void
Parameters
$extensionClassName : string

addFeature()

public addFeature(string $feature) : static
Parameters
$feature : string
Return values
static
public canEnablePermalinks() : bool
Return values
bool

canEnableTorchlight()

public canEnableTorchlight() : bool
Return values
bool

getExtensions()

public getExtensions() : array<string|int, mixed>
Return values
array<string|int, mixed>

hasFeature()

public hasFeature(string $feature) : bool
Parameters
$feature : string
Return values
bool

isDocumentationPage()

public isDocumentationPage() : bool
Return values
bool

normalizeIndentationLevel()

Normalize indentation for an un-compiled Markdown string.

public static normalizeIndentationLevel(string $string) : string
Parameters
$string : string
Return values
string

removeFeature()

public removeFeature(string $feature) : static
Parameters
$feature : string
Return values
static
public withPermalinks() : static
Return values
static

withTableOfContents()

public withTableOfContents() : static
Return values
static

configurePermalinksExtension()

protected configurePermalinksExtension() : void

determineIfTorchlightAttributionShouldBeInjected()

protected determineIfTorchlightAttributionShouldBeInjected() : bool
Return values
bool

findLineContentPositions()

Find the indentation level and position of the first line that has content.

protected static findLineContentPositions(array<int, string> $lines) : array<int, int>
Parameters
$lines : array<int, string>
Return values
array<int, int>

getNormalizedLines()

protected static getNormalizedLines(string $string) : array<int, string>
Parameters
$string : string
Return values
array<int, string>

injectTorchlightAttribution()

protected injectTorchlightAttribution() : string
Return values
string

        
On this page

Search results