Documentation
¶
Index ¶
- type Manager
- func (p *Manager) ApplyLayout(name string, content []byte, vars liquid.Bindings) ([]byte, error)
- func (p *Manager) FindLayout(base string, fmp *map[string]interface{}) (tpl *liquid.Template, err error)
- func (p *Manager) Render(w io.Writer, src []byte, vars liquid.Bindings, filename string, lineNo int) error
- func (p *Manager) RenderTemplate(src []byte, vars liquid.Bindings, filename string, lineNo int) ([]byte, error)
- func (p *Manager) SassIncludePaths() []string
- func (p *Manager) TemplateEngine() *liquid.Engine
- func (p *Manager) WriteSass(w io.Writer, b []byte) error
- type MarkerContext
- type MarkerType
- type Options
- type Renderers
- type TOCEntry
- type TOCOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Options
// contains filtered or unexported fields
}
Manager applies a rendering transformation to a file.
func (*Manager) ApplyLayout ¶
ApplyLayout applies the named layout to the content.
func (*Manager) FindLayout ¶
func (p *Manager) FindLayout(base string, fmp *map[string]interface{}) (tpl *liquid.Template, err error)
FindLayout returns a template for the named layout.
func (*Manager) Render ¶
func (p *Manager) Render(w io.Writer, src []byte, vars liquid.Bindings, filename string, lineNo int) error
Render sends content through SASS and/or Liquid -> Markdown
func (*Manager) RenderTemplate ¶
func (p *Manager) RenderTemplate(src []byte, vars liquid.Bindings, filename string, lineNo int) ([]byte, error)
RenderTemplate renders a Liquid template
func (*Manager) SassIncludePaths ¶
SassIncludePaths returns an array of sass include directories.
func (*Manager) TemplateEngine ¶
TemplateEngine returns the Liquid engine.
type MarkerContext ¶ added in v0.3.0
type MarkerContext struct {
Type MarkerType
Node *html.Node // The text node containing the marker
ParentList *html.Node // The <ul> or <ol> node if in a list
MarkerText string // The actual marker text: "{:toc}" or "{::toc}"
IsBlock bool // true for {::toc}, false for {:toc}
}
MarkerContext describes a TOC marker's location and context in the DOM
type MarkerType ¶ added in v0.3.0
type MarkerType int
MarkerType identifies the context of a TOC marker in the HTML
const ( MarkerStandalone MarkerType = iota MarkerInUnorderedList MarkerInOrderedList MarkerInCodeBlock )
type Options ¶
type Options struct {
RelativeFilenameToURL tags.LinkTagHandler
ThemeDir string
}
Options configures a rendering manager.
type Renderers ¶
type Renderers interface {
ApplyLayout(string, []byte, liquid.Bindings) ([]byte, error)
Render(io.Writer, []byte, liquid.Bindings, string, int) error
RenderTemplate([]byte, liquid.Bindings, string, int) ([]byte, error)
}
Renderers applies transformations to a document.
type TOCOptions ¶ added in v0.3.0
type TOCOptions struct {
MinLevel int // Minimum heading level to include (1-6)
MaxLevel int // Maximum heading level to include (1-6)
UseJekyllHTML bool // Use Jekyll-compatible HTML structure
}
TOCOptions configures TOC generation behavior