transpiler

package
v0.1.1-0...-fb6f0c3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddImportPath = func(c libsass.Compiler, i []string) error {
	return c.Option(libsass.IncludePaths(i))
}

In a variable to make it testable

View Source
var Compile = func(c libsass.Compiler) error {
	return c.Run()
}

In a variable to make it testable

View Source
var NewCompiler = func(dst io.Writer, src io.Reader) (libsass.Compiler, error) {
	return libsass.New(dst, src)
}

In a variable to make it testable

Functions

This section is empty.

Types

type SassTranspiler

type SassTranspiler struct {
	// contains filtered or unexported fields
}

func New

func New() *SassTranspiler

Get a new instance of the SassTranspiler

func (*SassTranspiler) FileSystem

func (tr *SassTranspiler) FileSystem() afero.Fs

func (*SassTranspiler) GetDest

func (tr *SassTranspiler) GetDest(srcRoot, src, dest string) string

Generate css destination pathname `srcRoot` is the directory where .scss sources are. (example : /src/scss_root) `src` is the absolute path of a file source. (example : /src/scss_root/menu/menu.scss) `dest` is either the absolute filename of the destination or the root directory of destination

func (*SassTranspiler) GetFiles

func (tr *SassTranspiler) GetFiles(dir string) []afero.File

Fetch all scss files in the directory passed as parameter

func (*SassTranspiler) IsSassFile

func (tr *SassTranspiler) IsSassFile(f string) bool

Test if a file is a .scss or .sass

func (*SassTranspiler) Run

func (tr *SassTranspiler) Run(source, dest string, files []afero.File, imports []string) error

Transpile scss files in `files` to `dest` directory

func (*SassTranspiler) SetFileSystem

func (tr *SassTranspiler) SetFileSystem(fileSystem afero.Fs)

func (*SassTranspiler) SetVerbose

func (tr *SassTranspiler) SetVerbose(verbose bool)

func (*SassTranspiler) Verbose

func (tr *SassTranspiler) Verbose() bool

type Transpiler

type Transpiler interface {
	Verbose() bool
	SetVerbose(bool)
	FileSystem() afero.Fs
	SetFileSystem(afero.Fs)
	Run(source, dest string, files []afero.File, imports []string) error
	GetFiles(dir string) []afero.File
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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