Add IsRenderable to Page

As pages are read from the target, they will be assessed if they should
be rendered or not.  The logic for IsRenderable is in the parser/page.go
and looks for anything exception '<'.
This commit is contained in:
Noah Campbell
2013-09-18 10:17:43 -07:00
parent d8e1834910
commit 67b2abaf09
3 changed files with 66 additions and 32 deletions

View File

@@ -39,6 +39,7 @@ type Content []byte
type Page interface {
FrontMatter() FrontMatter
Content() Content
IsRenderable() bool
}
type page struct {
@@ -55,6 +56,10 @@ func (p *page) FrontMatter() FrontMatter {
return p.frontmatter
}
func (p *page) IsRenderable() bool {
return p.render
}
// ReadFrom reads the content from an io.Reader and constructs a page.
func ReadFrom(r io.Reader) (p Page, err error) {
reader := bufio.NewReader(r)