renderers

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 29 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Options
	// contains filtered or unexported fields
}

Manager applies a rendering transformation to a file.

func New

func New(c config.Config, options Options) (*Manager, error)

New makes a rendering manager.

func (*Manager) ApplyLayout

func (p *Manager) ApplyLayout(name string, content []byte, vars liquid.Bindings) ([]byte, error)

ApplyLayout applies the named layout to the content.

func (*Manager) FindLayout

func (p *Manager) FindLayout(base string, fmp *map[string]interface{}) (tpl *liquid.Template, err error)

FindLayout returns a template for the named layout.

func (*Manager) Render

func (p *Manager) Render(w io.Writer, src []byte, vars liquid.Bindings, filename string, lineNo int) error

Render sends content through SASS and/or Liquid -> Markdown

func (*Manager) RenderTemplate

func (p *Manager) RenderTemplate(src []byte, vars liquid.Bindings, filename string, lineNo int) ([]byte, error)

RenderTemplate renders a Liquid template

func (*Manager) SassIncludePaths

func (p *Manager) SassIncludePaths() []string

SassIncludePaths returns an array of sass include directories.

func (*Manager) TemplateEngine

func (p *Manager) TemplateEngine() *liquid.Engine

TemplateEngine returns the Liquid engine.

func (*Manager) WriteSass

func (p *Manager) WriteSass(w io.Writer, b []byte) error

WriteSass converts a SASS file and writes it to w.

type MarkerContext added in v0.3.0

type MarkerContext struct {
	Type       MarkerType
	Node       *html.Node // The text node containing the marker
	ParentList *html.Node // The <ul> or <ol> node if in a list
	MarkerText string     // The actual marker text: "{:toc}" or "{::toc}"
	IsBlock    bool       // true for {::toc}, false for {:toc}
}

MarkerContext describes a TOC marker's location and context in the DOM

type MarkerType added in v0.3.0

type MarkerType int

MarkerType identifies the context of a TOC marker in the HTML

const (
	MarkerStandalone MarkerType = iota
	MarkerInUnorderedList
	MarkerInOrderedList
	MarkerInCodeBlock
)

type Options

type Options struct {
	RelativeFilenameToURL tags.LinkTagHandler
	ThemeDir              string
}

Options configures a rendering manager.

type Renderers

type Renderers interface {
	ApplyLayout(string, []byte, liquid.Bindings) ([]byte, error)
	Render(io.Writer, []byte, liquid.Bindings, string, int) error
	RenderTemplate([]byte, liquid.Bindings, string, int) ([]byte, error)
}

Renderers applies transformations to a document.

type TOCEntry added in v0.3.0

type TOCEntry struct {
	ID       string
	Level    int
	Text     string
	Children []*TOCEntry
}

TOCEntry represents a heading in the table of contents

type TOCOptions added in v0.3.0

type TOCOptions struct {
	MinLevel      int  // Minimum heading level to include (1-6)
	MaxLevel      int  // Maximum heading level to include (1-6)
	UseJekyllHTML bool // Use Jekyll-compatible HTML structure
}

TOCOptions configures TOC generation behavior

Jump to

Keyboard shortcuts

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