hyogen.md

0.14.0

Template Syntax

hyogen.md extends Markdown with HTML-comment directives and Mustache-style expressions. Everything below is available in @b4moss/hyogen-md@0.14.0.

Two layers

LayerWhereWhat you can write
Expressions{{ }} / {{{ }}} in Markdown body; ${} inside code fencesExpressions only — no statements
Logic blocks<!-- @hg … @endhg --> or <!--@@ … @@-->Declarations, includes, if / each, and more

Topics

Data and output

  • Front matter — YAML metadata and component props
  • Expressions — {{ }}, defaults, ternary, fence ${}
  • Methods — .toLocaleString, allowed property .length

Blocks and directives

Safety

Minimal example

---
title: Greeting
---

# {{ title }}

<!--
@hg
const name = "world"
@endhg
-->

Hello {{ name | "stranger" }}!

Rendered:

# Greeting

Hello world!

Try it in the Playground.