algernon: Index | Files

package themes

import ""


Package Files

codestyle.go data.go html.go indent.go versions.go


const (
    // DefaultStyleFilename is the default stylesheet filename (GCSS)
    DefaultStyleFilename = "style.gcss"

    // DefaultTheme is the default theme when rendering Markdown and for error pages
    DefaultTheme = "default"
const (
    // HighlightJSversion is the version to be used for highlight.js.
    // See for the latest version.
    HighlightJSversion = "9.12.0"

    // MUIVersion is the version to be used to MUI.
    // See for the latest version.
    MUIVersion = "0.9.27"
const (
    // DefaultCustomCodeStyle is the default highlight.js style for custom CSS
    DefaultCustomCodeStyle = "github"


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 HighlightHead Uses

func HighlightHead(codeStyle string) string

HighlightHead creates the HTML code for linking with a stylesheet for highlighting <code> tags with the given highlight.js code style

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 creates the HTML code for a material design framework called MUI (

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. 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)

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)

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-02-18. Refresh now. Tools for package owners.