pipelines

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipeline

type Pipeline struct {
	PipelineOptions
	// contains filtered or unexported fields
}

Pipeline applies a rendering transformation to a file.

func NewPipeline

func NewPipeline(c config.Config, options PipelineOptions) (*Pipeline, error)

NewPipeline makes a rendering pipeline.

func (*Pipeline) ApplyLayout

func (p *Pipeline) ApplyLayout(name string, data []byte, e map[string]interface{}) ([]byte, error)

ApplyLayout applies the named layout to the data.

func (*Pipeline) CopySassFileIncludes

func (p *Pipeline) CopySassFileIncludes() error

CopySassFileIncludes copies sass partials into a temporary directory, removing initial underscores. TODO delete the temp directory when done

func (*Pipeline) FindLayout

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

FindLayout returns a template for the named layout.

func (*Pipeline) LayoutsDir

func (p *Pipeline) LayoutsDir() string

LayoutsDir returns the path to the layouts directory.

func (*Pipeline) OutputExt

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

OutputExt returns the output extension.

func (*Pipeline) Render

func (p *Pipeline) Render(w io.Writer, b []byte, filename string, lineNo int, e map[string]interface{}) ([]byte, error)

Render returns nil iff it wrote to the writer

func (*Pipeline) SassIncludePaths

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

SassIncludePaths returns an array of sass include directories.

func (*Pipeline) SourceDir

func (p *Pipeline) SourceDir() string

SourceDir returns the site source directory. Seeing how far we can bend the Law of Demeter.

func (*Pipeline) TemplateEngine

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

TemplateEngine returns the Liquid engine.

func (*Pipeline) WriteSass

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

WriteSass converts a SASS file and writes it to w.

type PipelineInterface

type PipelineInterface interface {
	ApplyLayout(string, []byte, map[string]interface{}) ([]byte, error)
	OutputExt(pathname string) string
	Render(io.Writer, []byte, string, int, map[string]interface{}) ([]byte, error)
}

PipelineInterface applies transformations to a document.

type PipelineOptions

type PipelineOptions struct {
	RelativeFilenameToURL tags.LinkTagHandler
}

PipelineOptions configures a pipeline.

Jump to

Keyboard shortcuts

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