renderers

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 22 Imported by: 0

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, data []byte, vars liquid.Bindings) ([]byte, error)

ApplyLayout applies the named layout to the data.

func (*Manager) CopySassFileIncludes

func (p *Manager) CopySassFileIncludes() error

CopySassFileIncludes copies sass partials into a temporary directory, removing initial underscores.

func (*Manager) FindLayout

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

FindLayout returns a template for the named layout.

func (*Manager) OutputExt

func (p *Manager) OutputExt(pathname string) string

OutputExt returns the output extension.

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)
	OutputExt(pathname string) string
	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