gassfile

package
v0.0.0-...-445083e Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gassfile provides support for the 'gassfile': a file containing a list of SCSS sources to transpile to CSS.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSource is returned when a [Source] is invalid.
	ErrInvalidSource = errors.New("gassfile: source is invalid")
)

Functions

func DetermineSourceSyntax

func DetermineSourceSyntax(ext string) godartsass.SourceSyntax

DetermineSourceSyntax returns the godartsass.SourceSyntax of a file based on its extension.

Types

type Gassfile

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

Gassfile is a plaintext file containing a collecton of *Source, delimited by newlines.

func New

func New(path string) (*Gassfile, error)

New creates a new *Gassfile from the given path.

func NewFromReader

func NewFromReader(r io.Reader) (*Gassfile, error)

NewFromReader creates a new *Gassfile from the given io.Reader.

func (*Gassfile) Sources

func (g *Gassfile) Sources() iter.Seq[*Source]

Sources returns an iterator over g's list of *Source.

type Source

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

Source represents a collection of paths used to transpile Sass to CSS.

func NewSource

func NewSource(input, output string) (*Source, error)

func (*Source) Input

func (s *Source) Input() string

Input returns the input path of the Source.

func (*Source) InputDir

func (s *Source) InputDir() string

InputDir returns the directory of the Source's input.

func (*Source) Output

func (s *Source) Output() string

Output returns the output of the Source. If the output ends with a CSS file, that is returned, otherwise the name of the input file is used.

func (*Source) OutputMap

func (s *Source) OutputMap() string

OutputMap returns the map file of the Source's output.

func (*Source) Relative

func (s *Source) Relative() ([]string, error)

Relative returns a slice containing absolute paths to directories relative to the input of the Source.

func (*Source) Syntax

func (s *Source) Syntax() godartsass.SourceSyntax

Syntax returns the syntax used by the input based on its file extension.

Jump to

Keyboard shortcuts

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