statping: Index | Examples | Files

package source

import ""

Package source holds all the assets for Statping. This includes CSS, JS, SCSS, HTML and other website related content. This package uses Rice to compile all assets into a single 'rice-box.go' file.

Required Dependencies

- rice -> - sass ->

Compile Assets

To compile all the HTML, JS, SCSS, CSS and image assets you'll need to have rice and sass installed on your local system.

sass source/scss/base.scss source/css/base.css
cd source && rice embed-go

More info on:

Code generated by go generate; DO NOT EDIT. This file was generated by robots at 2020-02-01 06:06:45.83918 +0000 UTC

This contains the most recently Markdown source for the Statping Wiki.



Package Files

doc.go source.go wiki.go


var (
    TmplBox     *rice.Box // HTML and other small files from the 'source/tmpl' directory, this will be loaded into '/assets'
    DefaultScss = []string{"scss/main.scss", "scss/base.scss", "scss/mobile.scss"}
var CompiledWiki = []byte("" /* 73684 byte string literal not displayed */)

CompiledWiki contains all of the Statping Wiki pages from the Github Wiki repo.

func Assets Uses

func Assets() error

Assets will load the Rice boxes containing the CSS, SCSS, JS, and HTML files.

func CompileSASS Uses

func CompileSASS(files ...string) error

CompileSASS will attempt to compile the SASS files into CSS

func CopyAllToPublic Uses

func CopyAllToPublic(box *rice.Box) error

CopyAllToPublic will copy all the files in a rice box into a local folder

func CopyToPublic Uses

func CopyToPublic(box *rice.Box, path, file string) error

CopyToPublic will create a file from a rice Box to the '/assets' directory

func CreateAllAssets Uses

func CreateAllAssets(folder string) error

CreateAllAssets will dump HTML, CSS, SCSS, and JS assets into the '/assets' directory

func DeleteAllAssets Uses

func DeleteAllAssets(folder string) error

DeleteAllAssets will delete the '/assets' folder

func HelpMarkdown Uses

func HelpMarkdown() string

HelpMarkdown will return the Markdown of into HTML

func MakePublicFolder Uses

func MakePublicFolder(folder string) error

MakePublicFolder will create a new folder

func OpenAsset Uses

func OpenAsset(path string) string

OpenAsset returns a file's contents as a string



func SaveAsset Uses

func SaveAsset(data []byte, path string) error

SaveAsset will save an asset to the '/assets/' folder.


data := []byte("alert('helloooo')")
SaveAsset(data, "js/test.js")

func UsingAssets Uses

func UsingAssets(folder string) bool

UsingAssets returns true if the '/assets' folder is found in the directory

Package source imports 9 packages (graph). Updated 2020-05-14. Refresh now. Tools for package owners.