Documentation
¶
Index ¶
- Constants
- type Configuration
- type MacroTemplate
- type Setting
- func WithAttribute(key, value string) Setting
- func WithAttributes(attrs map[string]string) Setting
- func WithCSS(href string) Setting
- func WithFilename(filename string) Setting
- func WithHeaderFooter(value bool) Setting
- func WithLastUpdated(value time.Time) Setting
- func WithMacroTemplate(name string, t MacroTemplate) Setting
Constants ¶
const ( // LastUpdatedFormat key to the time format for the `last updated` document attribute LastUpdatedFormat string = "2006-01-02 15:04:05 -0700" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Filename string AttributeOverrides map[string]string LastUpdated time.Time CSS string // contains filtered or unexported fields }
Configuration the configuration used when rendering a document
func NewConfiguration ¶
func NewConfiguration(settings ...Setting) Configuration
NewConfiguration returns a new configuration
func (Configuration) Clone ¶
func (c Configuration) Clone() Configuration
Clone return a clone of the current configuration
func (Configuration) MacroTemplate ¶
func (c Configuration) MacroTemplate(name string) (MacroTemplate, error)
MacroTemplate finds and returns a user macro function by specified name.
type MacroTemplate ¶
MacroTemplate an interface of template for user macro.
type Setting ¶
type Setting func(config *Configuration)
Setting a setting to customize the configuration used during parsing and rendering of a document
func WithAttribute ¶ added in v0.4.0
WithAttribute function to set an attribute as if it was passed as an argument in the CLI
func WithAttributes ¶
WithAttributes function to set the `attribute overrides`
func WithFilename ¶
WithFilename function to set the `filename` setting in the config
func WithHeaderFooter ¶
WithHeaderFooter function to set the `include header/footer` setting in the config
func WithLastUpdated ¶
WithLastUpdated function to set the `last updated` option in the renderer context (default is `time.Now()`)
func WithMacroTemplate ¶
func WithMacroTemplate(name string, t MacroTemplate) Setting
WithMacroTemplate defines the given template to a user macro with the given name