doc

package
v0.0.0-...-fc8933c Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Categories = []Category{
	{"Calculator Operations", []string{
		"basic",
		"prog",
		"sci",
		"stack",
		"stat",
		"zc",
	}},
	{"Units of Measure", []string{
		"len",
		"temp",
	}},
	{"Library", []string{
		"angle",
		"anno",
		"bool",
		"color",
		"complex",
		"cmp",
		"crypto",
		"decimal",
		"format",
		"geo",
		"hof",
		"rand",
		"rational",
		"text",
		"time",
	}},
	{"Tables", []string{
		"entity",
		"emoji",
		"epsg",
		"si",
		"tz",
	}},
}
View Source
var GroupTitles = map[string]string{
	"angle":    "Angular calculations",
	"anno":     "Annotations",
	"basic":    "Basic calculator",
	"bool":     "Boolean operations",
	"color":    "Color conversions",
	"complex":  "Complex numbers",
	"cmp":      "Comparisons",
	"crypto":   "Cryptographic ciphers",
	"decimal":  "Decimal numbers",
	"entity":   "HTML entity characters",
	"emoji":    "Unicode emoji characters",
	"epsg":     "EPSG Geodetic Parameter Dataset",
	"format":   "Value formatting",
	"geo":      "Geo-spatial calculations",
	"hof":      "Higher-order functions",
	"len":      "Length",
	"prog":     "Programmer's calculator",
	"rand":     "Random number generation",
	"rational": "Rational numbers (fractions)",
	"sci":      "Scientific calculator",
	"si":       "International System of Units",
	"stack":    "Stack manipulations",
	"stat":     "Statistical calculations",
	"temp":     "Temperature",
	"text":     "Text operations",
	"time":     "Date, time, and duration operations",
	"tz":       "Time zone database",
	"zc":       "About this calculator",
}
View Source
var Preludes = map[string]string{
	"time": `
<!-- eval: 'Jan 2 2006 15:04:05 -0700 MST' now-set -->
<!-- eval: 'MST' local-zone -->
	`,
}

Functions

func Group

func Group(ops []*Op) map[string][]*Op

func SortedNames

func SortedNames(table map[string]*Op) []string

func Table

func Table(ops []*Op) map[string]*Op

Types

type Category

type Category struct {
	Name   string
	Groups []string
}

type Expect

type Expect struct {
	In  string
	Out string
}

type FuncDecl

type FuncDecl struct {
	Name    string
	Params  []Param
	Returns []Param
}

type Op

type Op struct {
	Group   string
	Name    string
	Funcs   []FuncDecl
	Aliases []string
	Title   string
	Desc    string
	Example []Expect
	Macro   string
}

func FilterByGroup

func FilterByGroup(src []*Op, group string) []*Op

func ParseSourceFile

func ParseSourceFile(name string) ([]*Op, error)

func ParseSourceFiles

func ParseSourceFiles(dir string) ([]*Op, error)

func (Op) AllNames

func (o Op) AllNames() []string

type OpByGroup

type OpByGroup []*Op

func (OpByGroup) Len

func (b OpByGroup) Len() int

func (OpByGroup) Less

func (b OpByGroup) Less(i, j int) bool

func (OpByGroup) Swap

func (b OpByGroup) Swap(i, j int)

type Param

type Param struct {
	Name string
	Type string
	All  bool
}

func (Param) String

func (p Param) String() string

Jump to

Keyboard shortcuts

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