Documentation ¶
Index ¶
- Variables
- func NewDoubleSpaceParser() parser.InlineParser
- func NewHiddenParser() parser.InlineParser
- func NewRenderer() renderer.NodeRenderer
- func StringToBytes(v string) (b []byte)
- func TGMD() goldmark.Markdown
- type Element
- type HiddenAST
- type Renderer
- type SpecialChar
- type SpecialRune
- type SpecialTag
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &config{ headings: [6]Element{ { Style: BoldTg, Prefix: "", }, { Style: BoldTg, Prefix: "", }, { Style: BoldTg, Prefix: "", }, { Style: ItalicsTg, Prefix: "", }, { Style: ItalicsTg, Prefix: "", }, { Style: ItalicsTg, Prefix: "", }, }, listBullets: [3]rune{ CircleSymbol.Rune(), SquareSymbol.Rune(), TriangleSymbol.Rune(), }, }
View Source
var DoubleSpace = &doubleSpace{}
DoubleSpace ...
View Source
var Hidden = &hidden{}
View Source
var KindDoubleSpace = gast.NewNodeKind("DoubleSpace")
View Source
var KindHidden = ast.NewNodeKind("Hidden")
View Source
var Strikethroughs = &strikethrough{}
Functions ¶
func NewDoubleSpaceParser ¶
func NewDoubleSpaceParser() parser.InlineParser
NewDoubleSpaceParser ...
func NewHiddenParser ¶
func NewHiddenParser() parser.InlineParser
NewHiddenParser initialize parser.InlineParser.
func NewRenderer ¶
func NewRenderer() renderer.NodeRenderer
NewRenderer initialize Renderer as renderer.NodeRenderer.
func StringToBytes ¶
StringToBytes convert a string to a byte slice.
Types ¶
type Element ¶
type Element struct { Style SpecialTag Prefix string Postfix string }
Element styles object.
type HiddenAST ¶
type HiddenAST struct {
ast.BaseInline
}
HiddenAST abstract semantic tree for "hidden".
type Renderer ¶
type Renderer struct{}
Renderer implement renderer.NodeRenderer object.
func (*Renderer) RegisterFuncs ¶
func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs add AST objects to Renderer.
type SpecialChar ¶
type SpecialChar byte
SpecialChar define custom byte object.
const ( UnderscoreChar SpecialChar = '_' AsteriskChar SpecialChar = '*' OpenBracketChar SpecialChar = '[' CloseBracketChar SpecialChar = ']' OpenParenChar SpecialChar = '(' CloseParenChar SpecialChar = ')' OpenBraceChar SpecialChar = '{' CloseBraceChar SpecialChar = '}' HashChar SpecialChar = '#' PlusChar SpecialChar = '+' MinusChar SpecialChar = '-' EqualChar SpecialChar = '=' DotChar SpecialChar = '.' TildeChar SpecialChar = '~' PipeChar SpecialChar = '|' ExclamationChar SpecialChar = '!' GreaterThanChar SpecialChar = '>' LessThanChar SpecialChar = '<' BackqouteChar SpecialChar = '`' SpaceChar SpecialChar = ' ' NewLineChar SpecialChar = '\n' SlashChar SpecialChar = '\\' TabChar SpecialChar = '\t' )
define characters.
func (SpecialChar) Bytes ¶
func (sc SpecialChar) Bytes(num int) []byte
func (SpecialChar) Escaped ¶
func (sc SpecialChar) Escaped() []byte
Escaped return SpecialChar as escaped byte char.
type SpecialRune ¶
type SpecialRune rune
SpecialRune define custom rune object.
const ( CircleSymbol SpecialRune = '•' TriangleSymbol SpecialRune = '⁃' SquareSymbol SpecialRune = '‣' )
define symbols.
type SpecialTag ¶
type SpecialTag []SpecialChar
SpecialTag define Markdown formatting characters.
var ( BoldTg SpecialTag = []SpecialChar{AsteriskChar, AsteriskChar, AsteriskChar} StrikethroughTg SpecialTag = []SpecialChar{TildeChar, TildeChar, TildeChar} UnderlineTg SpecialTag = []SpecialChar{UnderscoreChar, UnderscoreChar} HiddenTg SpecialTag = []SpecialChar{PipeChar, PipeChar} ItalicsTg SpecialTag = []SpecialChar{UnderscoreChar} CodeTg SpecialTag = []SpecialChar{BackqouteChar, BackqouteChar, BackqouteChar} SpanTg SpecialTag = []SpecialChar{BackqouteChar} )
define Telegram Markdown formatting tags.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.