Markdown
module Markdown| Assembly | Nacara.Plugin.Markdown |
| Attributes | [<RequireQualifiedAccess>] |
Functions and values
create () : IPlugin
create () : IPluginThe markdown plugin, with its default options.
createWith (configure: MarkdownOptions -> MarkdownOptions) : IPlugin
createWith (configure: MarkdownOptions -> MarkdownOptions) : IPluginThe markdown plugin, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
defaults: MarkdownOptionsdirective (name: string) (render: DirectiveContext -> ReactElement) (site: Site) : Site
directive (name: string) (render: DirectiveContext -> ReactElement) (site: Site) : SiteAdd a :::name directive of your own to a site.
| Parameter | |
|---|---|
name | What follows the colons, matched ignoring case. |
render | Given what the directive holds, its markup. |
site | The site being described. |
Site.create "Blog"
|> Markdown.register
|> Markdown.directive "youtube" (fun directive ->
Html.iframe [ prop.src $"https://www.youtube-nocookie.com/embed/{directive.Argument.Value}" ]
)
directivePlugin (name: string) (render: DirectiveContext -> ReactElement) : IPlugin
directivePlugin (name: string) (render: DirectiveContext -> ReactElement) : IPluginA :::name directive of your own, as a plugin.
It takes precedence over a built-in directive of the same name. Of two with the same name, the one registered last is used.
| Parameter | |
|---|---|
name | What follows the colons, matched ignoring case. |
render | Given what the directive holds, its markup. An exception it throws fails the build at the directive's line. |
frontMatterFormat: FrontMatterFormat
frontMatterFormat: FrontMatterFormatHow a markdown file carries its front matter: a block at the top of the file.
githubRepo (value: string option) (options: MarkdownOptions) : MarkdownOptions
githubRepo (value: string option) (options: MarkdownOptions) : MarkdownOptionsRepository used to expand issue and commit references, for example MangelMaxime/Nacara.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
registerWith (configure: MarkdownOptions -> MarkdownOptions) (site: Site) : Site
registerWith (configure: MarkdownOptions -> MarkdownOptions) (site: Site) : SiteAdd markdown to a site, configured.
| Parameter | |
|---|---|
configure | Given the defaults, the options to use. Anything it leaves alone keeps its default. |
site | The site being described. |
renderBlock<'FrontMatter> (context: PageContext<'FrontMatter>) (text: string) : ReactElement
renderBlock<'FrontMatter> (context: PageContext<'FrontMatter>) (text: string) : ReactElementMarkdown from front matter or data, rendered as a block: paragraphs, lists.
Links resolve as they do in a page: to a file beside the page, or from the project root with a leading /. A link that names no file is looked up by source path, then kept as a path in the site. One that resolves to nothing is written as it is, for the link validator to report.
| Parameter | |
|---|---|
context | The page being rendered. |
text | The markdown. |
renderInline<'FrontMatter> (context: PageContext<'FrontMatter>) (text: string) : ReactElement
renderInline<'FrontMatter> (context: PageContext<'FrontMatter>) (text: string) : ReactElementMarkdown from front matter or data, rendered as a run of text, with no paragraph around it.
Links resolve as with renderBlock. Text of several paragraphs keeps them.
| Parameter | |
|---|---|
context | The page being rendered. |
text | The markdown. |
strictLinks (value: bool) (options: MarkdownOptions) : MarkdownOptions
strictLinks (value: bool) (options: MarkdownOptions) : MarkdownOptionsFail the build on a link that points at no page.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
toc (value: TocRange) (options: MarkdownOptions) : MarkdownOptions
toc (value: TocRange) (options: MarkdownOptions) : MarkdownOptionsHeading levels collected into the table of contents, for pages that do not say.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |
warnOnUnknownLanguage (value: bool) (options: MarkdownOptions) : MarkdownOptions
warnOnUnknownLanguage (value: bool) (options: MarkdownOptions) : MarkdownOptionsReport a fence naming a language no highlighter covers.
| Parameter | |
|---|---|
value | The value to use. |
options | The options so far. |