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(_ TmdFormatOptions) (formattedData []byte, err error)
- func (lib *Lib) FormatTmd(tmdData []byte, _ TmdFormatOptions) (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) GenerateTitle(_ TitleGenOptions) (title []byte, err error)
- func (lib *Lib) SetInputTmd(tmdData []byte) error
- func (lib *Lib) Version() (version []byte, err error)
- type TitleGenOptions
- type TmdFormatOptions
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.
func (*Lib) Destroy ¶ added in v0.0.6
func (lib *Lib) Destroy()
Destroy releases the resource allocated for a Lib.
func (*Lib) Format ¶ added in v0.0.6
func (lib *Lib) Format(_ TmdFormatOptions) (formattedData []byte, err error)
Format formats the current set input TMD. formattedData == null means nothing is done in the formatting.
func (*Lib) FormatTmd ¶ added in v0.0.6
func (lib *Lib) FormatTmd(tmdData []byte, _ TmdFormatOptions) (formattedData []byte, err error)
FormatTmd formats a TMD document. formattedData == null means nothing is done in the formatting.
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) GenerateTitle ¶ added in v0.0.7
func (lib *Lib) GenerateTitle(_ TitleGenOptions) (title []byte, err error)
GenerateTitle retrieves the title of the current set input TMD. A nil title means the current set input TMD doesn't define a title.
func (*Lib) SetInputTmd ¶ added in v0.0.6
SetInputTmd prepares the input TMD data for later using.
type TitleGenOptions ¶ added in v0.0.7
type TitleGenOptions struct {
// contains filtered or unexported fields
}
Blank now. Just for backward compatibility.
type TmdFormatOptions ¶ added in v0.0.7
type TmdFormatOptions struct {
// contains filtered or unexported fields
}
Blank now. Just for backward compatibility.