presentation

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package presentation makes HTML presentations from Markdown files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	ctx context.Context,
	w io.Writer,
	sources []string,
	withOptions ...Option,
) error

New parses Markdown sources and renders them as an HTML presentation.

func Parse added in v0.0.8

func Parse(sources []string) ([]Source, Frontmatter, error)

Parse reads and parses Markdown sources, extracting frontmatter from the first source.

func Render added in v0.0.8

func Render(
	ctx context.Context,
	w io.Writer,
	sources []Source,
	metadata Frontmatter,
	withOptions ...Option,
) error

Render writes parsed sources and their metadata as an HTML document.

Types

type Frontmatter added in v0.0.7

type Frontmatter struct {
	ID          string
	Title       string
	Description string
	Keywords    string
	Author      string
	Created     time.Time
	Duration    time.Duration
	Favicon     template.HTML
	Stylesheet  template.CSS
}

type Option

type Option func(*options) error

func WithFooterTemplate added in v0.0.7

func WithFooterTemplate(t *template.Template) Option

func WithHeaderTemplate added in v0.0.7

func WithHeaderTemplate(t *template.Template) Option

func WithImageCache added in v0.0.7

func WithImageCache(cache *mdcoach.ImageCache) Option

func WithImageQuality

func WithImageQuality(q int) Option

func WithImageSizeLimit

func WithImageSizeLimit(w, h int) Option

func WithParser

func WithParser(p parser.Parser) Option

func WithRenderer

func WithRenderer(r html.Renderer) Option

type Source added in v0.0.8

type Source struct {
	Path         string
	Source       []byte
	Presentation ast.Node
}

Source contains a Markdown source file and its parsed AST.

Directories

Path Synopsis
Package index maintains an HTML page that links to compiled presentations.
Package index maintains an HTML page that links to compiled presentations.

Jump to

Keyboard shortcuts

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