Documentation
¶
Index ¶
- func WrapTheme(themeFs afero.Fs, themeFile string, content []byte, props map[string]any) ([]byte, error)
- type DefaultRenderer
- type EntryRenderer
- type RenderContext
- func (rc *RenderContext) CreateFile(path string) (io.Writer, error)
- func (rc *RenderContext) CurrentFile() afero.File
- func (rc *RenderContext) MkdirAll(path string, perm fs.FileMode) error
- func (rc *RenderContext) PopDir() string
- func (rc *RenderContext) PopFile() afero.File
- func (rc *RenderContext) PushDir(dir string)
- func (rc *RenderContext) Source(node tree.Node) ([]byte, error)
- func (rc *RenderContext) WorkDir() string
- type Renderer
- type RendererOption
- type RendererOptionFunc
- func WithBuildFS(buildFS afero.Fs) RendererOptionFunc
- func WithEntryRenderers(renderers ...EntryRenderer) RendererOptionFunc
- func WithFS(siteFS afero.Fs, themeFS afero.Fs, buildFS afero.Fs) RendererOptionFunc
- func WithSiteFS(siteFS afero.Fs) RendererOptionFunc
- func WithThemeFS(themeFS afero.Fs) RendererOptionFunc
- type Templater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultRenderer ¶
type DefaultRenderer struct { }
func (*DefaultRenderer) Close ¶
func (r *DefaultRenderer) Close(node tree.Node, context *RenderContext) error
func (*DefaultRenderer) Kind ¶
func (r *DefaultRenderer) Kind() tree.NodeKind
func (*DefaultRenderer) Open ¶
func (r *DefaultRenderer) Open(node tree.Node, context *RenderContext) error
type EntryRenderer ¶
type EntryRenderer interface { Kind() tree.NodeKind Open(node tree.Node, context *RenderContext) error Close(node tree.Node, context *RenderContext) error }
type RenderContext ¶
type RenderContext struct {
// contains filtered or unexported fields
}
func (*RenderContext) CreateFile ¶
func (rc *RenderContext) CreateFile(path string) (io.Writer, error)
func (*RenderContext) CurrentFile ¶
func (rc *RenderContext) CurrentFile() afero.File
func (*RenderContext) MkdirAll ¶
func (rc *RenderContext) MkdirAll(path string, perm fs.FileMode) error
func (*RenderContext) PopDir ¶
func (rc *RenderContext) PopDir() string
func (*RenderContext) PopFile ¶
func (rc *RenderContext) PopFile() afero.File
func (*RenderContext) PushDir ¶
func (rc *RenderContext) PushDir(dir string)
func (*RenderContext) WorkDir ¶
func (rc *RenderContext) WorkDir() string
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...RendererOption) *Renderer
type RendererOption ¶
type RendererOptionFunc ¶
func WithBuildFS ¶
func WithBuildFS(buildFS afero.Fs) RendererOptionFunc
func WithEntryRenderers ¶
func WithEntryRenderers(renderers ...EntryRenderer) RendererOptionFunc
func WithSiteFS ¶
func WithSiteFS(siteFS afero.Fs) RendererOptionFunc
func WithThemeFS ¶
func WithThemeFS(themeFS afero.Fs) RendererOptionFunc
func (RendererOptionFunc) Apply ¶
func (apply RendererOptionFunc) Apply(p *Renderer) error
Click to show internal directories.
Click to hide internal directories.