tmpl

package
v1.2.1-0...-837fef5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const WordDefinitionTempl = `` /* 1857-byte string literal not displayed */

Variables

View Source
var CSS_REG *regexp.Regexp
View Source
var ENTRY_REG *regexp.Regexp
View Source
var FONT_REG *regexp.Regexp
View Source
var JS_REG *regexp.Regexp
View Source
var SOUND_REG *regexp.Regexp

Functions

func WrapContent

func WrapContent(dict *model.PlainDictionaryItem, keyEntry *model.MdictKeyWordIndex, definition string) ([]byte, error)

func WrapResource

func WrapResource(dictId string, keyWord string, resource []byte) ([]byte, error)

Types

type ContentPreHandlePipeline

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

type Handler

type Handler interface {
	Replace(dictId string, entry string, resource []byte) (string, []byte)
	Match(dictId string, key string) bool
}

type HandlerFont

type HandlerFont struct {
}

func (*HandlerFont) Match

func (r *HandlerFont) Match(dictId string, key string) bool

func (*HandlerFont) Replace

func (r *HandlerFont) Replace(dictId string, keyWord string, resource []byte) (string, []byte)

type Replacer

type Replacer interface {
	Replace(dictId string, entry *model.MdictKeyWordIndex, htmlContent string) (*model.MdictKeyWordIndex, string)
}

type ReplacerCss

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

func (*ReplacerCss) Replace

func (r *ReplacerCss) Replace(dictId string, entry *model.MdictKeyWordIndex, html string) (*model.MdictKeyWordIndex, string)

func (ReplacerCss) SetDictContext

func (r ReplacerCss) SetDictContext(item *model.DictionaryItem)

type ReplacerEntry

type ReplacerEntry struct {
}

func (*ReplacerEntry) Replace

func (r *ReplacerEntry) Replace(dictId string, entry *model.MdictKeyWordIndex, html string) (*model.MdictKeyWordIndex, string)

type ReplacerImage

type ReplacerImage struct {
}

func (*ReplacerImage) Replace

func (r *ReplacerImage) Replace(dictId string, entry *model.MdictKeyWordIndex, html string) (*model.MdictKeyWordIndex, string)

type ReplacerJs

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

func (*ReplacerJs) Replace

func (r *ReplacerJs) Replace(dictId string, entry *model.MdictKeyWordIndex, html string) (*model.MdictKeyWordIndex, string)

func (*ReplacerJs) SetDictContext

func (r *ReplacerJs) SetDictContext(item *model.DictionaryItem)

type ReplacerSound

type ReplacerSound struct {
}

func (*ReplacerSound) Replace

func (r *ReplacerSound) Replace(dictId string, entry *model.MdictKeyWordIndex, html string) (*model.MdictKeyWordIndex, string)

Jump to

Keyboard shortcuts

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