MarkdownDocument
in package
implements
MarkdownDocumentContract, Stringable
uses
InteractsWithFrontMatter
A MarkdownDocument is a simpler alternative to a MarkdownPage.
It's an object that contains a parsed FrontMatter split from the body of the Markdown file.
Table of Contents
Interfaces
- MarkdownDocumentContract
- Stringable
Properties
Methods
- __construct() : mixed
- __toString() : string
- data() : FrontMatter|mixed
- Get a value from the computed page data, or fallback to the page's front matter, then to the default value.
- has() : bool
- See if a value exists in the computed page data or the front matter.
- markdown() : Markdown
- Return the document's Markdown object.
- matter() : FrontMatter|mixed
- Get the front matter object, or a value from within.
- parse() : static
Properties
$markdown
public
Markdown
$markdown
$matter
public
FrontMatter
$matter
Methods
__construct()
public
__construct([FrontMatter|array<string|int, mixed> $matter = [] ][, Markdown|string $body = '' ]) : mixed
Parameters
- $matter : FrontMatter|array<string|int, mixed> = []
- $body : Markdown|string = ''
__toString()
public
__toString() : string
Return values
stringdata()
Get a value from the computed page data, or fallback to the page's front matter, then to the default value.
public
data([string $key = null ][, mixed $default = null ]) : FrontMatter|mixed
Parameters
- $key : string = null
- $default : mixed = null
Return values
FrontMatter|mixedhas()
See if a value exists in the computed page data or the front matter.
public
has(string $key) : bool
Parameters
- $key : string
Return values
boolmarkdown()
Return the document's Markdown object.
public
markdown() : Markdown
Return values
Markdownmatter()
Get the front matter object, or a value from within.
public
matter([string $key = null ][, mixed $default = null ]) : FrontMatter|mixed
Parameters
- $key : string = null
- $default : mixed = null
Return values
FrontMatter|mixedparse()
public
static parse(string $path) : static
Parameters
- $path : string