common

package
v2.0.0-rc14 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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:             config.Dynamic(config.RouteSave),
		PathReload:           config.Dynamic(config.RouteReload),
		PathGetHtmlForFile:   config.Dynamic(config.RouteHtmlForFile),
		PathGetLabelsForFile: config.Dynamic(config.RouteLabelsForFile),
		PathRunBlock:         config.Dynamic(config.RouteRunBlock),

		KeyMdFileIndex: config.KeyMdFileIndex,
		KeyBlockIndex:  config.KeyBlockIndex,
		KeyIsTitleOn:   config.KeyIsTitleOn,
		KeyIsNavOn:     config.KeyIsNavOn,
		KeyMdSessID:    config.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