twfiles

package
v0.0.0-...-5d42b3b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package twfiles implements tailwind.Dist against a filesystem. Implementations are provided against the OS filesystem and for net/http.FileSystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFiles

type HTTPFiles struct {
	http.FileSystem                          // underlying http FileSystem
	NameMapFunc     func(name string) string // name conversion func, default returns name+".css"
}

HTTPFiles implements tailwind.Dist against a net/http.FileSystem. By default the file name mapings are the name of the tailwind section plus ".css", e.g. "base.css", "utilities.css", "components.css".

func New

func New(baseDir string) *HTTPFiles

New returns a tailwind.Dist instance that reads from the underlying OS directory you provide. Implementation is done via net/http Filesystem.

func NewHTTP

func NewHTTP(fs http.FileSystem) *HTTPFiles

NewHTTP returns an HTTP file instance which reads from the underlying net/http.Filesystem. Files are mapped by default so e.g. requests for "base" look for "base.css".

func (*HTTPFiles) OpenDist

func (hf *HTTPFiles) OpenDist(name string) (io.ReadCloser, error)

OpenDist implements tailwind.Dist.

Jump to

Keyboard shortcuts

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