mirror of
https://github.com/fengxxc/wechatmp2markdown.git
synced 2026-03-03 03:00:46 +08:00
first commit
This commit is contained in:
33
parse/model.go
Normal file
33
parse/model.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package parse
|
||||
|
||||
type Article struct {
|
||||
title string
|
||||
meta string
|
||||
tags string
|
||||
content []Block
|
||||
}
|
||||
|
||||
type Block struct {
|
||||
tokens []Token
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
ttype TokenType
|
||||
text string
|
||||
attrs map[string]string
|
||||
}
|
||||
|
||||
type TokenType int32
|
||||
|
||||
const (
|
||||
TITLE TokenType = iota // 标题
|
||||
LINK // 链接
|
||||
NORMAL_TEXT // 文字
|
||||
STRONG_TEXT // 强调文字
|
||||
ITALIC_TEXT // 斜体文字
|
||||
IMAGE // 图片
|
||||
TABLE // 表格
|
||||
CODE_INLINE // 代码 内联
|
||||
CODE_BLOCK // 代码 块
|
||||
CITE // 引用
|
||||
)
|
||||
Reference in New Issue
Block a user