Add Page.RawContent() to access raw Markdown as a string.

In particular, RawContent() excludes the metadata header.

This is necessary in the use case of embedding remarkjs.com slides, as it needs
the unprocessed Markdown content to generate the slides.
This commit is contained in:
Marc-Antoine Ruel 2015-07-02 09:32:57 -04:00 committed by Bjørn Erik Pedersen
parent dd732e84f4
commit c9fc0e786f

View file

@ -726,6 +726,10 @@ func (p *Page) parse(reader io.Reader) error {
return nil return nil
} }
func (p *Page) RawContent() string {
return string(p.rawContent)
}
func (p *Page) SetSourceContent(content []byte) { func (p *Page) SetSourceContent(content []byte) {
p.Source.Content = content p.Source.Content = content
} }