mirror of
https://github.com/NohamR/papeer.git
synced 2026-05-25 12:27:20 +00:00
accept several urls, fix tests, remove unused book struct
This commit is contained in:
@@ -9,6 +9,10 @@ type chapter struct {
|
||||
config *ScrapeConfig
|
||||
}
|
||||
|
||||
func NewEmptyChapter() chapter {
|
||||
return chapter{"", "", "", "", []chapter{}, NewScrapeConfigNoInclude()}
|
||||
}
|
||||
|
||||
func NewChapter(body, name, author, content string, subChapters []chapter, config *ScrapeConfig) chapter {
|
||||
return chapter{body, name, author, content, subChapters, config}
|
||||
}
|
||||
@@ -21,6 +25,10 @@ func (c chapter) Name() string {
|
||||
return c.name
|
||||
}
|
||||
|
||||
func (c *chapter) SetName(name string) {
|
||||
c.name = name
|
||||
}
|
||||
|
||||
func (c chapter) Author() string {
|
||||
return c.author
|
||||
}
|
||||
@@ -32,3 +40,7 @@ func (c chapter) Content() string {
|
||||
func (c chapter) SubChapters() []chapter {
|
||||
return c.subChapters
|
||||
}
|
||||
|
||||
func (c *chapter) AddSubChapter(newChapter chapter) {
|
||||
c.subChapters = append(c.subChapters, newChapter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user