Documentation ¶
Overview ¶
COPYRIGHT https://github.com/golang/tools/blob/master/cmd/html2article/conv.go
Index ¶
- Constants
- func AddConvert(f func(string) string)
- func AddRule(name string, rule *Rule)
- func AttrRegExp(attr string) *regexp.Regexp
- func Compress(str string) string
- func Convert(ct string) string
- func GetHtml(urlStr string) (htmlArticle string, err error)
- func Remove(ct, tag string) string
- func ToAticle(htmlStr string) (htmlArticle string, err error)
- type Article
- type ReplaceFunc
- type Rule
- type Style
Constants ¶
View Source
const ( Foreign = iota Void )
Variables ¶
This section is empty.
Functions ¶
func AddConvert ¶
func AttrRegExp ¶
Types ¶
type Article ¶
type Article struct { // Basic Html string `json:"content_html"` Content string `json:"content"` Title string `json:"title"` Publishtime int64 `json:"publish_time"` // Others Images []string `json:"images"` ReadContent string `json:"read_content"` // contains filtered or unexported fields }
func (*Article) GetContentNode ¶
func (*Article) ParseReadContent ¶
func (a *Article) ParseReadContent()
ParseReadContent parse the ReadContent to be readability
type ReplaceFunc ¶
type Rule ¶
type Rule struct { Patterns []string Tp int Replacement ReplaceFunc }
Click to show internal directories.
Click to hide internal directories.