Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (29 sloc) 1.3 KB
title description godocref date categories menu keywords signature
.RenderString
Renders markup to HTML.
2019-12-18
functions
docs
parent
functions
markdown
goldmark
render
.RenderString MARKUP

{{< new-in "0.62.0" >}}

.RenderString is a method on Page that renders some markup to HTML using the content renderer defined for that page (if not set in the options).

Note that this method does not parse and render shortcodes.

The method takes an optional map argument with these options:

display ("inline") : inline or block. If inline (default), surrounding ´

` on short snippets will be trimmed.

markup (defaults to the Page's markup) : See identifiers in List of content formats.

Some examples:

{{ $optBlock := dict "display" "block" }}
{{ $optOrg := dict "markup" "org" }}
{{ "**Bold Markdown**" | $p.RenderString }}
{{  "**Bold Block Markdown**" | $p.RenderString  $optBlock }}
{{  "/italic org mode/" | $p.RenderString  $optOrg }}

Note that this method is more powerful than the similar markdownify function as it also supports Render Hooks and it has options to render other markup formats.

You can’t perform that action at this time.