class Markdown (View source)

Properties

protected Factory $view

The view factory implementation.

protected string $theme

The current theme being used when generating emails.

protected array $componentPaths

The registered component paths.

static protected bool $withSecuredEncoding

Indicates if secure encoding should be enabled.

Methods

__construct(Factory $view, array $options = [])

Create a new Markdown renderer instance.

render(string $view, array $data = [], CssToInlineStyles|null $inliner = null)

Render the Markdown template into HTML.

renderText(string $view, array $data = [])

Render the Markdown template into text.

static HtmlString
parse(string $text, bool $encoded = false)

Parse the given Markdown text into HTML.

static MarkdownConverter
converter(array $config = [])

Get a Markdown converter instance.

array
htmlComponentPaths()

Get the HTML component paths.

array
textComponentPaths()

Get the text component paths.

array
componentPaths()

Get the component paths.

void
loadComponentsFrom(array $paths = [])

Register new mail component paths.

$this
theme(string $theme)

Set the default theme to be used.

string
getTheme()

Get the theme currently being used by the renderer.

static void
withSecuredEncoding()

Enable secured encoding when parsing Markdown.

static void
withoutSecuredEncoding()

Disable secured encoding when parsing Markdown.

static void
flushState()

Flush the class's global state.

Details

__construct(Factory $view, array $options = [])

Create a new Markdown renderer instance.

Parameters

Factory $view
array $options

HtmlString render(string $view, array $data = [], CssToInlineStyles|null $inliner = null)

Render the Markdown template into HTML.

Parameters

string $view
array $data
CssToInlineStyles|null $inliner

Return Value

HtmlString

HtmlString renderText(string $view, array $data = [])

Render the Markdown template into text.

Parameters

string $view
array $data

Return Value

HtmlString

static HtmlString parse(string $text, bool $encoded = false)

Parse the given Markdown text into HTML.

Parameters

string $text
bool $encoded

Return Value

HtmlString

static MarkdownConverter converter(array $config = [])

internal  
 

Get a Markdown converter instance.

Parameters

array $config

Return Value

MarkdownConverter

array htmlComponentPaths()

Get the HTML component paths.

Return Value

array

array textComponentPaths()

Get the text component paths.

Return Value

array

protected array componentPaths()

Get the component paths.

Return Value

array

void loadComponentsFrom(array $paths = [])

Register new mail component paths.

Parameters

array $paths

Return Value

void

$this theme(string $theme)

Set the default theme to be used.

Parameters

string $theme

Return Value

$this

string getTheme()

Get the theme currently being used by the renderer.

Return Value

string

static void withSecuredEncoding()

Enable secured encoding when parsing Markdown.

Return Value

void

static void withoutSecuredEncoding()

Disable secured encoding when parsing Markdown.

Return Value

void

static void flushState()

Flush the class's global state.

Return Value

void