diff options
Diffstat (limited to 'present/parse.go')
-rw-r--r-- | present/parse.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/present/parse.go b/present/parse.go index a78a85b6a..449d5ed5c 100644 --- a/present/parse.go +++ b/present/parse.go @@ -41,6 +41,16 @@ func (d *Doc) Render(w io.Writer, t *template.Template) error { return t.ExecuteTemplate(w, "root", data) } +// Render renders the section to the given writer using the provided template. +func (s *Section) Render(w io.Writer, t *template.Template) error { + data := struct { + *Section + Template *template.Template + PlayEnabled bool + }{s, t, PlayEnabled} + return t.ExecuteTemplate(w, "section", data) +} + type ParseFunc func(ctx *Context, fileName string, lineNumber int, inputLine string) (Elem, error) // Register binds the named action, which does not begin with a period, to the |