render

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPDFMargin float64 = 1
	DefaultPDFScale  float64 = 1
)

Variables

This section is empty.

Functions

func HTML

func HTML() *cli.Command

func HTMLMiddleware added in v0.3.0

func HTMLMiddleware(funcs ...HTMLTransformerOptionFunc) pipeline.Middleware

func Markdown

func Markdown() *cli.Command

func MarkdownMiddleware added in v0.3.0

func MarkdownMiddleware(funcs ...MarkdownTransformerOptionFunc) pipeline.Middleware

func PDF

func PDF() *cli.Command

func PDFMiddleware added in v0.3.0

func PDFMiddleware(funcs ...PDFTransformerOptionFunc) pipeline.Middleware

func Root

func Root() *cli.Command

func TemplateMiddleware added in v0.3.0

func TemplateMiddleware(funcs ...TemplateTransformerOptionFunc) pipeline.Middleware

func ToggleableMiddleware added in v0.3.0

func ToggleableMiddleware(t pipeline.Transformer, enabled bool) pipeline.Middleware

Types

type HTMLTransformerOptionFunc

type HTMLTransformerOptionFunc func(opts *HTMLTransformerOptions)

func WithLayoutURL

func WithLayoutURL(layoutURL string) HTMLTransformerOptionFunc

func WithLayoutVars

func WithLayoutVars(vars map[string]any) HTMLTransformerOptionFunc

type HTMLTransformerOptions

type HTMLTransformerOptions struct {
	*MarkdownTransformerOptions
	LayoutURL  string
	LayoutVars map[string]any
}

func NewHTMLTransformerOptions

func NewHTMLTransformerOptions(funcs ...HTMLTransformerOptionFunc) *HTMLTransformerOptions

type MarkdownTransformerOptionFunc

type MarkdownTransformerOptionFunc func(opts *MarkdownTransformerOptions)

func WithSourceURL added in v0.2.0

func WithSourceURL(sourceURL *url.URL) MarkdownTransformerOptionFunc

type MarkdownTransformerOptions

type MarkdownTransformerOptions struct {
	SourceURL *url.URL
}

type PDFTransformerOptionFunc

type PDFTransformerOptionFunc func(opts *PDFTransformerOptions)

func WithMarginBottom

func WithMarginBottom(margin float64) PDFTransformerOptionFunc

func WithMarginLeft

func WithMarginLeft(margin float64) PDFTransformerOptionFunc

func WithMarginRight

func WithMarginRight(margin float64) PDFTransformerOptionFunc

func WithMarginTop

func WithMarginTop(margin float64) PDFTransformerOptionFunc

func WithScale

func WithScale(scale float64) PDFTransformerOptionFunc

type PDFTransformerOptions

type PDFTransformerOptions struct {
	MarginTop    float64
	MarginLeft   float64
	MarginRight  float64
	MarginBottom float64
	Scale        float64
}

func NewPDFTransformerOptions

func NewPDFTransformerOptions(funcs ...PDFTransformerOptionFunc) *PDFTransformerOptions

type TemplateTransformerOptionFunc

type TemplateTransformerOptionFunc func(opts *TemplateTransformerOptions)

func WithVars

func WithVars(vars map[string]any) TemplateTransformerOptionFunc

type TemplateTransformerOptions

type TemplateTransformerOptions struct {
	Vars  map[string]any
	Funcs template.FuncMap
}

Jump to

Keyboard shortcuts

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