Documentation ¶
Overview ¶
Package markdown is middleware to render markdown files as HTML on-the-fly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultTemplate ¶
GetDefaultTemplate returns the default template.
Types ¶
type Config ¶
type Config struct { // Markdown renderer Renderer blackfriday.Renderer // Base path to match PathScope string // List of extensions to consider as markdown files Extensions map[string]struct{} // List of style sheets to load for each markdown file Styles []string // List of JavaScript files to load for each markdown file Scripts []string // Template(s) to render with Template *template.Template }
Config stores markdown middleware configurations.
type Data ¶
type Data struct { httpserver.Context Doc map[string]interface{} Styles []string Scripts []string Meta map[string]string Files []FileInfo }
Data represents a markdown document.
type FileInfo ¶
FileInfo represents a file in a particular server context. It wraps the os.FileInfo struct.
type Markdown ¶
type Markdown struct { // Server root Root string // Jail the requests to site root with a mock file system FileSys http.FileSystem // Next HTTP handler in the chain Next httpserver.Handler // The list of markdown configurations Configs []*Config // The list of index files to try IndexFiles []string }
Markdown implements a layer of middleware that serves markdown as HTML.
Click to show internal directories.
Click to hide internal directories.