Documentation
¶
Overview ¶
The package is a simple implementation which is mainly for "tmd fmt" and "tmd gen" commands.
The APIs provided in the lib package is not concurrently safe.
Index ¶
- type HtmlGenOptions
- type Lib
- func (lib *Lib) Destroy()
- func (lib *Lib) Format() (formattedData []byte, err error)
- func (lib *Lib) FormatTmd(tmdData []byte) (formattedData []byte, err error)
- func (lib *Lib) GenerateHtml(options HtmlGenOptions) (htmlData []byte, err error)
- func (lib *Lib) GenerateHtmlFromTmd(tmdData []byte, options HtmlGenOptions) (htmlData []byte, err error)
- func (lib *Lib) SetInputTmd(tmdData []byte) error
- func (lib *Lib) Version() (version []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HtmlGenOptions ¶
type HtmlGenOptions struct { // Enabled custom app name list. // Comma or semocolon seperated. // Now, only "html" is supported. EnabledCustomApps string `json:"enabledCustomApps"` // A suffix which will be appended to all HTML id attribute values. IdentSuffix string `json:"identSuffix"` // A suffix which will be appended to all auto-generated HTML id attribute values. AutoIdentSuffix string `json:"autoIdentSuffix"` // Whether or not render the root block. RenderRoot bool `json:"renderRoot"` }
The options used in HTML generation.
type Lib ¶ added in v0.0.6
type Lib struct {
// contains filtered or unexported fields
}
All methods of Lib are not concurently safe.
func NewLib ¶ added in v0.0.6
NewLib creates a Lib. If it succeeds, call Lib.Destroy method to release the resouce and Lib.Render method to render a TMD document.
func (*Lib) Destroy ¶ added in v0.0.6
func (lib *Lib) Destroy()
Destroy releases the resource allocated for a Lib.
func (*Lib) GenerateHtml ¶ added in v0.0.6
func (lib *Lib) GenerateHtml(options HtmlGenOptions) (htmlData []byte, err error)
GenerateHtml converts the current set input TMD into HTML.
func (*Lib) GenerateHtmlFromTmd ¶ added in v0.0.6
func (lib *Lib) GenerateHtmlFromTmd(tmdData []byte, options HtmlGenOptions) (htmlData []byte, err error)
GenerateHtmlFromTmd converts a TMD document into HTML.
func (*Lib) SetInputTmd ¶ added in v0.0.6
SetInputTmd prepares the input TMD data for later using.
Click to show internal directories.
Click to hide internal directories.