Documentation ¶
Index ¶
- Constants
- Variables
- func ParseHeader(text string, post *Post)
- type BlockElement
- type CodeBlock
- type CodeText
- type DateFormat
- type EmpText
- type HTMLPost
- type HTMLSummary
- type InlineElement
- type InlineType
- type Kind
- type Language
- type Link
- type List
- type ListItem
- type Paragraph
- type PlainText
- type Post
- type Posts
- func (p Posts) FilterByKind(wanted Kind) Posts
- func (p Posts) FilterByTag(wanted Tag) Posts
- func (p Posts) FilterByYear(year string) Posts
- func (p Posts) HTMLSummaries() []*HTMLSummary
- func (p Posts) Len() int
- func (p Posts) Less(i, j int) bool
- func (p Posts) Limit(limit int) Posts
- func (p Posts) Sort() Posts
- func (p Posts) Swap(i, j int)
- func (p Posts) TagList() []string
- func (p Posts) YearList() []string
- type Site
- type StaticPage
- type StrongEmpText
- type StrongText
- type SubSubTitle
- type SubTitle
- type Tag
- type XMLPost
Constants ¶
View Source
const ( KIND_NOTE = Kind("note") KIND_STORY = Kind("story") KIND_ARTICLE = Kind("article") KIND_INVALID = Kind("") )
View Source
const ( LANGUAGE_EN = Language("en") LANGUAGE_NL = Language("nl") LANGUAGE_INVALID = Language("") )
View Source
const ( TITLE_PREFIX = "= " SUBTITLE_PREFIX = "== " SUBSUBTITLE_PREFIX = "=== " PARAGRAPH_SEPARATOR = "\n\n" LINE_SEPARATOR = "\n" CODE_PREFIX = "----\n" CODE_SUFFIX = "\n----" LISTITEM_PREFIX = "* " PARAGRAPH_CONTINUATION = "\n+\n" )
Variables ¶
View Source
var (
ErrInvalidPost = errors.New("invalid post")
)
Functions ¶
func ParseHeader ¶
Types ¶
type BlockElement ¶
type DateFormat ¶
type DateFormat int
const ( DATE_SHORT DateFormat = iota DATE_LONG DATE_FORMAL //Sat, 12 Sep 2020 12:32:00 +0200 )
type HTMLSummary ¶
type InlineElement ¶
func ParseInline ¶
func ParseInline(text string) []InlineElement
type InlineType ¶
type InlineType int
type ListItem ¶
type ListItem []InlineElement
type Paragraph ¶
type Paragraph []InlineElement
type Post ¶
type Post struct { Title string Author string Kind Kind Language Language Path string Date time.Time Tags []Tag Content []BlockElement }
func (Post) FormattedDate ¶
func (p Post) FormattedDate(format DateFormat) string
func (*Post) HTMLSummary ¶
func (p *Post) HTMLSummary() *HTMLSummary
type Posts ¶
type Posts []Post
func (Posts) FilterByKind ¶
func (Posts) FilterByTag ¶
func (Posts) FilterByYear ¶
func (Posts) HTMLSummaries ¶
func (p Posts) HTMLSummaries() []*HTMLSummary
type Site ¶
type Site struct {
// contains filtered or unexported fields
}
func (*Site) AddFilePost ¶
func (*Site) RenderHTML ¶
type StaticPage ¶
type StrongEmpText ¶
type StrongEmpText string
func (StrongEmpText) InlineHTML ¶
func (set StrongEmpText) InlineHTML() string
func (StrongEmpText) Text ¶
func (set StrongEmpText) Text() string
type StrongText ¶
type StrongText string
func (StrongText) InlineHTML ¶
func (st StrongText) InlineHTML() string
func (StrongText) Text ¶
func (st StrongText) Text() string
type SubSubTitle ¶
type SubSubTitle string
func (SubSubTitle) BlockHTML ¶
func (st SubSubTitle) BlockHTML() string
func (SubSubTitle) Text ¶
func (st SubSubTitle) Text() string
Click to show internal directories.
Click to hide internal directories.