renderers

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 22 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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.

Jump to

Keyboard shortcuts

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