Documentation ¶
Index ¶
- Constants
- type Context
- func (ctx *Context) Deadline() (deadline time.Time, ok bool)
- func (ctx *Context) Done() <-chan struct{}
- func (ctx *Context) Err() error
- func (ctx *Context) GetAndIncrementExampleBlockCounter() int
- func (ctx *Context) GetAndIncrementImageCounter() int
- func (ctx *Context) GetAndIncrementTableCounter() int
- func (ctx *Context) GetImagesDir() string
- func (ctx *Context) IncludeBlankLine() bool
- func (ctx *Context) IncludeHeaderFooter() bool
- func (ctx *Context) LastUpdated() string
- func (ctx *Context) SetIncludeBlankLine(b bool) bool
- func (ctx *Context) SetWithinDelimitedBlock(b bool) bool
- func (ctx *Context) SetWithinList(w bool)
- func (ctx *Context) Value(key interface{}) interface{}
- func (ctx *Context) WithinDelimitedBlock() bool
- func (ctx *Context) WithinList() bool
- type Option
Constants ¶
const ( // LastUpdatedFormat the time format for the `last updated` document attribute LastUpdatedFormat string = "2006/01/02 15:04:05 MST" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
Context is a custom implementation of the standard golang context.Context interface, which carries the types.Document which is being processed
func Wrap ¶
Wrap wraps the given `ctx` context into a new context which will contain the given `document` document.
func (*Context) Done ¶
func (ctx *Context) Done() <-chan struct{}
Done wrapper implementation of context.Context.Done()
func (*Context) GetAndIncrementExampleBlockCounter ¶
GetAndIncrementExampleBlockCounter returns the current value for the example block counter after internally incrementing it.
func (*Context) GetAndIncrementImageCounter ¶
GetAndIncrementImageCounter returns the current value for the image counter after internally incrementing it.
func (*Context) GetAndIncrementTableCounter ¶
GetAndIncrementTableCounter returns the current value for the table counter after internally incrementing it.
func (*Context) GetImagesDir ¶
GetImagesDir returns the value of the `imagesdir` attribute if it was set (as a string), empty string otherwise
func (*Context) IncludeBlankLine ¶
IncludeBlankLine indicates if blank lines should be rendered (default false)
func (*Context) IncludeHeaderFooter ¶
IncludeHeaderFooter returns the value of the 'LastUpdated' Option if it was present, otherwise it returns `false`
func (*Context) LastUpdated ¶
LastUpdated returns the value of the 'LastUpdated' Option if it was present, otherwise it returns the current time using the `2006/01/02 15:04:05 MST` format
func (*Context) SetIncludeBlankLine ¶
SetIncludeBlankLine sets the rendering context to include (or not) the blank lines
func (*Context) SetWithinDelimitedBlock ¶
SetWithinDelimitedBlock sets the rendering context to be within a delimited block
func (*Context) SetWithinList ¶
SetWithinList sets the rendering context to be within a list or a nest list
func (*Context) Value ¶
func (ctx *Context) Value(key interface{}) interface{}
Value wrapper implementation of context.Context.Value(interface{})
func (*Context) WithinDelimitedBlock ¶
WithinDelimitedBlock indicates if the current element to render is within a delimited block or not
func (*Context) WithinList ¶
WithinList indicates if the current element to render is within a list or not
type Option ¶
type Option func(ctx *Context)
Option the options when rendering a document
func Entrypoint ¶
Entrypoint function to set the `entrypoint` option in the renderer context
func IncludeHeaderFooter ¶
IncludeHeaderFooter function to set the `include header/footer` option in the renderer context
func LastUpdated ¶
LastUpdated function to set the `last updated` option in the renderer context (default is `time.Now()`)