types

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnjinError

type EnjinError struct {
	Title   string
	Summary string
	Content string
}

func NewEnjinError

func NewEnjinError(title, summary, content string) *EnjinError

func (*EnjinError) Html

func (e *EnjinError) Html() (html template.HTML)

func (*EnjinError) NjnData

func (e *EnjinError) NjnData() (data map[string]interface{})

type Format

type Format interface {
	This() interface{}
	Name() (name string)
	Label() (label string)
	Extensions() (extensions []string)
	Prepare(ctx context.Context, content string) (out context.Context, err error)
	Process(ctx context.Context, t Theme, content string) (html template.HTML, redirect string, err *EnjinError)
	IndexDocument(pg interface{}) (doc interface{}, err error)
	NewDocumentMapping(tag language.Tag) (doctype, analyzer string, dm *mapping.DocumentMapping)
}

type FormatProvider

type FormatProvider interface {
	ListFormats() (names []string)
	GetFormat(name string) (format Format)
	MatchFormat(filename string) (format Format, match string)
}

type Theme

type Theme interface {
	// FS returns the theme filesystem
	FS() fs.FileSystem
	// GetParentTheme returns a parent Theme instance
	GetParentTheme() (parent Theme)
	// GetBlockThemeNames returns a list of names of BlockThemes from theme.toml
	GetBlockThemeNames() (names []string)

	// NewTextTemplateWithContext constructs a new text/template with the given context
	NewTextTemplateWithContext(name string, ctx context.Context) (tmpl *textTemplate.Template, err error)
	// NewTextFuncMapWithContext constructs a new text/template.FuncMap with the given context
	NewTextFuncMapWithContext(ctx context.Context) (fm textTemplate.FuncMap)
	// RenderTextTemplateContent renders the given text/template content with the given context
	RenderTextTemplateContent(ctx context.Context, tmplContent string) (rendered string, err error)

	// NewHtmlTemplateWithContext constructs a new text/template with the given context
	NewHtmlTemplateWithContext(name string, ctx context.Context) (tmpl *htmlTemplate.Template, err error)
	// NewHtmlFuncMapWithContext constructs a new text/template.FuncMap with the given context
	NewHtmlFuncMapWithContext(ctx context.Context) (fm htmlTemplate.FuncMap)
	// RenderHtmlTemplateContent renders the given text/template content with the given context
	RenderHtmlTemplateContent(ctx context.Context, tmplContent string) (rendered string, err error)
}

Jump to

Keyboard shortcuts

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