html

package
v2.0.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AssetTypes *assetTypes = &assetTypes{
	JS:      "javascript",
	CSS:     "css",
	FAVICON: "favicon",
	HTML:    "html",
}

AssetTypes is an enum for the asset type keys

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Type string
	Path string
	Data string
}

Asset describes an asset type and its path

func (*Asset) AsCHexData

func (a *Asset) AsCHexData() string

AsCHexData processes the asset data so it may be used by C

func (*Asset) AsString

func (a *Asset) AsString() string

AsString returns the data as a READ ONLY string

func (*Asset) Dump

func (a *Asset) Dump()

Dump will output the asset to the terminal

func (*Asset) Load

func (a *Asset) Load(basedirectory string) error

Load the asset from disk

type AssetBundle

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

AssetBundle is a collection of Assets

func NewAssetBundle

func NewAssetBundle(pathToHTML string) (*AssetBundle, error)

NewAssetBundle creates a new AssetBundle struct containing the given html and all the assets referenced by it

func (*AssetBundle) ConvertToAssetDB

func (a *AssetBundle) ConvertToAssetDB() (*assetdb.AssetDB, error)

ConvertToAssetDB returns an assetdb.AssetDB initialized with the items in the AssetBundle

func (*AssetBundle) Dump

func (a *AssetBundle) Dump()

Dump will output the assets to the terminal

func (*AssetBundle) WriteToCFile

func (a *AssetBundle) WriteToCFile(targetDir string) (string, error)

WriteToCFile dumps all the assets to C files in the given directory

Jump to

Keyboard shortcuts

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