algernon: github.com/xyproto/algernon/themes Index | Files

package themes

import "github.com/xyproto/algernon/themes"

Index

Package Files

codestyle.go html.go indent.go mui.go styling.go

Constants

const (
    // DefaultCSSFilename is the default CSS stylesheet
    DefaultCSSFilename = "style.css"

    // DefaultGCSSFilename is the default GCSS stylesheet
    DefaultGCSSFilename = "style.gcss"

    // DefaultTheme is the default theme when rendering Markdown and for error pages
    DefaultTheme = "default"
)
const (
    // DefaultCustomCodeStyle is the default chroma style for custom CSS
    // See: https://xyproto.github.io/splash/docs/all.html for an overview
    DefaultCustomCodeStyle = "algol"
)
const MUICSS = "" /* 43316 byte string literal not displayed */

MUICSS is from http://cdn.muicss.com/mui-0.9.39-rc1/css/mui.min.css

const MUIJS = "" /* 19427 byte string literal not displayed */

MUIJS is from http://cdn.muicss.com/mui-0.9.39-rc1/js/mui.min.js

Variables

var (
    // MetaKeywords contains a selection of allowed keywords for the HTML meta tag
    MetaKeywords = []string{"application-name", "author", "description", "generator", "keywords", "robots", "language", "googlebot", "Slurp", "bingbot", "geo.position", "geo.placename", "geo.region", "ICBM", "viewport"}
)
func HTMLLink(text, url string, isDirectory bool) string

HTMLLink builds an HTML link given the link text, the URL to a file/directory and a boolean that is true if the given URL is to a directory.

func InsertDoctype Uses

func InsertDoctype(htmldata []byte) []byte

InsertDoctype inserts <doctype html> to the HTML, if missing. Does not check if the given data is HTML. Assumes it to be HTML.

func MaterialHead Uses

func MaterialHead() string

MaterialHead enables the Material style by adding CSS and JS tags that can go in a header

func MessagePage Uses

func MessagePage(title, body, theme string) string

MessagePage is an easy way to output a HTML page only given a title, the body (will be placed between the <body></body> tags) and the name of one of the built-in themes. Does not close <body> and <html>. Deprecated

func MessagePageBytes Uses

func MessagePageBytes(title string, body []byte, theme string) []byte

MessagePageBytes provides the same functionalityt as MessagePage, but with []byte instead of string, and without closing </body></html>

func NewTheme Uses

func NewTheme(theme string, body []byte, codestyle string)

NewTheme adds a new built-in theme

func NoPage Uses

func NoPage(filename, theme string) []byte

NoPage provides the same functionality as NoPage, but returns []byte

func OneLevelOfIndentation Uses

func OneLevelOfIndentation(data *[]byte, keyword string) string

OneLevelOfIndentation finds one level of whitespace, given indented data and a keyword to extract the whitespace in front of.

Returns either an empty string or the whitespace that represents one step of indentation in the given source code data.

func SimpleHTMLPage Uses

func SimpleHTMLPage(title, headline, inhead, body []byte) []byte

SimpleHTMLPage provides a quick way to build a HTML page

func StyleAmber Uses

func StyleAmber(amberdata []byte, url string) []byte

StyleAmber modifies Amber source code so that a link to the given stylesheet URL is added

func StyleHTML Uses

func StyleHTML(htmldata []byte, url string) []byte

StyleHTML modifies HTML source code so that a link to the given stylesheet URL is added

func StyleHead Uses

func StyleHead(theme string) []byte

StyleHead returns contents that goes in "<head>", as bytes. This is either CSS wrapped in a "<style>" tag, or "<link>" tags to CSS and JS.

func ThemeToCodeStyle Uses

func ThemeToCodeStyle(theme string) string

ThemeToCodeStyle returns the code highlight style that the given theme implicates

Package themes imports 3 packages (graph) and is imported by 1 packages. Updated 2018-10-21. Refresh now. Tools for package owners.