Skip to content
Honmaple
Documentation navigation

Parsers

On this page

Content parsers read .md, .org, and .html files as Pages or Sections.

Built-in Parsers

Parser Extension Engine Enabled by Default Description
markdown .md goldmark Yes Markdown with YAML or TOML front matter
orgmode .org org-golang Yes Default Org-mode parser
niklasfasching .org niklasfasching/go-org No Alternative Org-mode parser
html .html Go HTML parser No HTML documents or fragments

HTML and niklasfasching are registered in the CLI but must be enabled:

markups:
  html:
    enabled: true
  niklasfasching:
    enabled: true

Both Org-mode parsers handle .org. If both are enabled, niklasfasching takes precedence under the current registration order.

Metadata

Format Metadata Sources
Markdown YAML ---, TOML +++, or initial key: value lines
Org-mode A :PROPERTIES: drawer and initial #+KEY: or #+PROPERTY: lines
HTML title, meta, link, and script elements in head
---
title: "My article"
date: 2024-01-15
tags:
  - go
  - web
draft: false
---

Markdown Directive Blocks

Enable directive blocks:

markups:
  markdown:
    directive_blocks: true
:::export html
<div class="raw-html">
  <span>Unmodified HTML</span>
</div>
:::

:::center
This **Markdown** is rendered inside <div style="text-align: center;">.
:::

:::quote
This **Markdown** is rendered inside a blockquote.
:::

:::shortcode notice type=info
This **Markdown** is rendered before being passed as the shortcode body.

- static-site
- go
:::

See Shortcodes for :::shortcode.

HTML Metadata

HTML Element Front Matter Field
<title> title
<meta name="date" content="..."> date
<meta property="og:title" content="..."> og.title
<meta itemprop="description" content="..."> description
<link rel="stylesheet" href="..."> Appended to links
<script src="..."> Appended to scripts

Body and Summary

Format Body Summary Marker
Markdown Rendered Markdown <!--more-->
Org-mode Rendered Org #+snow: more or #+html: <!--more-->
HTML Body children, or the entire fragment without a document wrapper <!--more-->

Org-mode supports either of these markers:

summary
#+snow: more
content
summary
#+html: <!--more-->
content

Table of Contents

Enable markups._default.show_toc, or a parser-specific show_toc, to generate Toc.

Markdown and Org-mode use the heading hierarchy. The HTML parser reads h1 through h6, preserves existing IDs, and generates missing IDs.

Set markups._default.toc_id or the parser's toc_id:

Value Behavior
title Default: derive anchors from heading text, such as hello-world; Chinese characters are preserved
index Generate numbered anchors such as heading-1 and heading-1.1

Template Filter

Filter Description
parser:"markdown" Render a string with Markdown
parser:"orgmode" Render a string with the default Org-mode parser
parser:"niklasfasching" Render with go-org; requires markups.niklasfasching.enabled: true

Only enabled parsers are available. An unavailable or unknown parser causes a template error.

Limits and Errors

Markdown and Org-mode support individual lines up to approximately 1 MB. Markdown front matter must close with its opening delimiter type. Org-mode property drawers must end with :END:. Unclosed blocks cause a build error.

HTML parsing errors are returned and stop the build.