common

package
v2.0.0-rc07 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed common.css
	Css string
	//go:embed common.js
	Js string
)
View Source
var (
	ParamDefaultJsCss = ParamStructJsCss{
		MdHost: "www.yourmom.com",

		MaxNavWordLength: 43,

		PathSave:             session.PathSave,
		PathReload:           session.PathReload,
		PathGetHtmlForFile:   session.PathGetHtmlForFile,
		PathGetLabelsForFile: session.PathGetLabelsForFile,
		PathRunBlock:         session.PathRunBlock,

		KeyMdFileIndex: session.KeyMdFileIndex,
		KeyBlockIndex:  session.KeyBlockIndex,
		KeyIsTitleOn:   session.KeyIsTitleOn,
		KeyIsNavOn:     session.KeyIsNavOn,
		KeyMdSessID:    session.KeyMdSessID,

		MdSessID:          "notARealSessId",
		TransitionSpeedMs: 250,
	}
)

Functions

func AsTmpl

func AsTmpl(name, body string) string

func MakeFuncMap

func MakeFuncMap() map[string]interface{}

MakeFuncMap makes a string to function map for use in Go template rendering.

func MustHtmlTemplate

func MustHtmlTemplate(s string) *htmlTmpl.Template

func MustRenderHtml

func MustRenderHtml(
	tmplBody string, values any, tmplName string) htmlTmpl.HTML

func ParseAsHtmlTemplate

func ParseAsHtmlTemplate(s string) (*htmlTmpl.Template, error)

func ParseAsTextTemplate

func ParseAsTextTemplate(s string) (*textTmpl.Template, error)

Types

type ParamStructJsCss

type ParamStructJsCss struct {
	MdHost string

	MaxNavWordLength int

	PathRunBlock         string
	PathSave             string
	PathReload           string
	PathGetHtmlForFile   string
	PathGetLabelsForFile string

	KeyMdSessID    string
	KeyMdFileIndex string
	KeyBlockIndex  string
	KeyIsTitleOn   string
	KeyIsNavOn     string

	MdSessID          string
	TransitionSpeedMs int
}

Jump to

Keyboard shortcuts

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