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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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