Some godoc adjustments

This commit is contained in:
Bjørn Erik Pedersen
2022-04-21 10:59:13 +02:00
parent 05b45c35c8
commit 9a888c243a
8 changed files with 71 additions and 18 deletions

View File

@@ -78,13 +78,30 @@ type ChildCareProvider interface {
// ContentProvider provides the content related values for a Page.
type ContentProvider interface {
Content() (any, error)
// Plain returns the Page Content stripped of HTML markup.
Plain() string
// PlainWords returns a string slice from splitting Plain using https://pkg.go.dev/strings#Fields.
PlainWords() []string
// Summary returns a generated summary of the content.
// The breakpoint can be set manually by inserting a summary separator in the source file.
Summary() template.HTML
// Truncated returns whether the Summary is truncated or not.
Truncated() bool
// FuzzyWordCount returns the approximate number of words in the content.
FuzzyWordCount() int
// WordCount returns the number of words in the content.
WordCount() int
// ReadingTime returns the reading time based on the length of plain text.
ReadingTime() int
// Len returns the length of the content.
Len() int
}