mtemplatemd

package
v0.0.0-...-94ee829 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 5 Imported by: 3

Documentation

Overview

Package mtemplatemd provides a template helper function which allows an external Markdown file to be included and rendered.

Exists in its own package separate from ftemplate so that it can call into mmarkdown in order to offer all the project's standard Markdown niceties. mmarkdown calls into ftemplate, so we'd otherwise create a circular dependency.

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = template.FuncMap{
	"IncludeMarkdown": IncludeMarkdown,
}

FuncMap is a set of helper functions to make available in templates for the project.

Functions

func IncludeMarkdown

func IncludeMarkdown(ctx context.Context, filename string) template.HTML

Types

type ContextContainer

type ContextContainer struct {
	Dependencies []string
	// contains filtered or unexported fields
}

type ContextKey

type ContextKey struct{}

ContextKey is the name of the context key to which IncludeMarkdown will add filenames for included dependencies. This is important so that the caller can add them as dependencies to watch for rebuilds.

Jump to

Keyboard shortcuts

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