Documentation ¶
Index ¶
- Constants
- type Configuration
- type MacroTemplate
- type Setting
- func WithAttribute(key string, value interface{}) Setting
- func WithAttributes(attrs map[string]interface{}) Setting
- func WithBackEnd(backend string) Setting
- func WithCSS(hrefs []string) Setting
- func WithFigureCaption(caption 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 // TODO: move out of Configuration? Attributes types.Attributes LastUpdated time.Time WrapInHTMLBodyElement bool // flag to include the content in an html>body element CSS []string BackEnd string Macros map[string]MacroTemplate }
Configuration the configuration used when rendering a document
func NewConfiguration ¶
func NewConfiguration(settings ...Setting) *Configuration
NewConfiguration returns a new configuration
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 WithBackEnd ¶ added in v0.5.0
WithBackEnd sets the backend format, valid values are "html", "html5", "xhtml", "xhtml5", and "" (defaults to html5)
func WithFigureCaption ¶ added in v0.7.0
WithFigureCaption function to set the `fogure-caption` attribute
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