Documentation ¶
Index ¶
- Constants
- Variables
- func WrapContent(dict *model.PlainDictionaryItem, keyEntry *model.MdictKeyWordIndex, ...) ([]byte, error)
- func WrapResource(dictId string, keyWord string, resource []byte) ([]byte, error)
- type ContentPreHandlePipeline
- type Handler
- type HandlerFont
- type Replacer
- type ReplacerCss
- type ReplacerEntry
- type ReplacerImage
- type ReplacerJs
- type ReplacerSound
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)
Types ¶
type ContentPreHandlePipeline ¶
type ContentPreHandlePipeline struct {
// contains filtered or unexported fields
}
type HandlerFont ¶
type HandlerFont struct { }
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)
Click to show internal directories.
Click to hide internal directories.