variables

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package variables expands template variables inside Markdown content. Variables such as {{ book.title }} and {{ book.author }} are replaced before parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expand

func Expand(source []byte, cfg *config.BookConfig) []byte

Expand replaces template variables in Markdown source using config values.

func ExpandWithUnknown added in v0.8.0

func ExpandWithUnknown(source []byte, cfg *config.BookConfig) ([]byte, []string)

ExpandWithUnknown replaces template variables and also reports the ones it did not recognize, so the caller can warn instead of shipping a literal "{{ book.autor }}" to the reader.

Substitution deliberately skips fenced code blocks and inline code spans. A book that documents a templating syntax — including mdpress's own manual — shows that syntax inside code, and rewriting it there corrupts the example the page exists to display.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL