config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpXPath

func DumpXPath(tags []tree.Tag) string

func PrintMessage

func PrintMessage(msg string)

Types

type CmdArgs

type CmdArgs struct {
	ConfigFile string
	OutputDir  string
	GlobalVars map[string]string

	JsUrl           string
	CssUrl          string
	IncludeViews    []string
	ExcludeViews    []string
	IncludeControls []string
	ExcludeControls []string
	MathFontUrl     string
}

all the cmdargs that are needed for Config file reading

func NewDefaultCmdArgs

func NewDefaultCmdArgs() CmdArgs

type Config

type Config struct {
	Views map[string]map[string]string `json:"views"` // first key is group name

	Controls map[string]map[string][]string `json:"controls"` // input can be multiple paths/groups

	Files map[string]string `json:"files"` // rel paths in configFile, but abs paths here

	CssUrl    string `json:"css-url"` // for stylesheet link
	StylePath string `json:"style"`

	JsUrl       string `json:"js-url"`
	PxPerRem    int    `json:"px-per-rem"`    // for px(<X rem>) functin
	MathFontUrl string `json:"math-font-url"` // for math font woff2 file

	Search SearchConfig `json:"search"`
	// contains filtered or unexported fields
}

func ReadConfigFile

func ReadConfigFile(cmdArgs *CmdArgs) (*Config, error)

func (*Config) GetControls

func (c *Config) GetControls() map[string][]string

func (*Config) GetCssDst

func (c *Config) GetCssDst() string

func (*Config) GetJsDst

func (c *Config) GetJsDst() string

func (*Config) GetMathFontDst

func (c *Config) GetMathFontDst() string

func (*Config) GetViews

func (c *Config) GetViews() map[string]string

type SearchConfig

type SearchConfig struct {
	Indices map[string]SearchIndexConfig `json:"indices"`
	Ignore  []string                     `json:"ignore"`
}

type SearchIndexConfig

type SearchIndexConfig struct {
	TitleQuery string `json:"title-query"`

	ContentQueries []string `json:"content-queries"`

	Pages []string `json:"pages"` // XXX: is "views" a better name?
	// contains filtered or unexported fields
}

func (*SearchIndexConfig) ContentMatch

func (s *SearchIndexConfig) ContentMatch(xpath []tree.Tag) bool

func (*SearchIndexConfig) TitleMatch

func (s *SearchIndexConfig) TitleMatch(xpath []tree.Tag) bool

type XQuery

type XQuery interface {
	Match([]tree.Tag) bool
	Length() int
}

type XQueryData

type XQueryData struct {
	// contains filtered or unexported fields
}

func ParseXQuery

func ParseXQuery(source string) (*XQueryData, error)

func (*XQueryData) Length

func (q *XQueryData) Length() int

func (*XQueryData) Match

func (q *XQueryData) Match(tags []tree.Tag) bool

Jump to

Keyboard shortcuts

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