Documentation
¶
Index ¶
- Constants
- Variables
- func NewGoldmark(cfg GoldmarkConfig) goldmark.Markdown
- func NewGoldmarkWithLinkTransformer(cfg GoldmarkConfig) goldmark.Markdown
- func NewMdBookIDs() parser.IDs
- func NewParseContext() parser.ParseOption
- type AdmonitionExtender
- type AdmonitionNode
- type AdmonitionType
- type Builder
- func (b *Builder) AddFiles() error
- func (b *Builder) BuildEntry(entry *sitemap.Entry) error
- func (b *Builder) BuildIndex(entries []*sitemap.Entry) error
- func (b *Builder) Close() error
- func (b *Builder) GetHTMLConfig() *preprocessors.HTMLConfig
- func (b *Builder) LiveReload(version uint64)
- func (b *Builder) Name() string
- func (b *Builder) Serve(args string, version *uint64) error
- func (b *Builder) ShouldBuildIndex() bool
- type Config
- type GoldmarkConfig
- type Tab
Constants ¶
const (
DEFAULT_BIND = "0.0.0.0:8003"
)
Variables ¶
var KindAdmonition = ast.NewNodeKind("Admonition")
KindAdmonition is the NodeKind for AdmonitionNode
Functions ¶
func NewGoldmark ¶
func NewGoldmark(cfg GoldmarkConfig) goldmark.Markdown
NewGoldmark creates a configured goldmark instance with common extensions
func NewGoldmarkWithLinkTransformer ¶
func NewGoldmarkWithLinkTransformer(cfg GoldmarkConfig) goldmark.Markdown
NewGoldmarkWithLinkTransformer creates a goldmark instance with the mdLinkTransformer for HTML builder
func NewMdBookIDs ¶
NewMdBookIDs returns a new IDs instance that preserves underscores.
func NewParseContext ¶
func NewParseContext() parser.ParseOption
NewParseContext returns a parser.ParseOption that uses mdBook-compatible heading IDs.
Types ¶
type AdmonitionExtender ¶
type AdmonitionExtender struct{}
AdmonitionExtender is a goldmark extension for admonitions
func (*AdmonitionExtender) Extend ¶
func (e *AdmonitionExtender) Extend(m goldmark.Markdown)
type AdmonitionNode ¶
type AdmonitionNode struct {
ast.BaseBlock
AdmonitionType AdmonitionType
}
AdmonitionNode is an AST node for admonitions
func (*AdmonitionNode) Dump ¶
func (n *AdmonitionNode) Dump(source []byte, level int)
Dump dumps the node for debugging
func (*AdmonitionNode) Kind ¶
func (n *AdmonitionNode) Kind() ast.NodeKind
Kind returns the kind of the node
type AdmonitionType ¶
type AdmonitionType string
AdmonitionType represents the type of admonition
const ( AdmonitionNote AdmonitionType = "note" AdmonitionTip AdmonitionType = "tip" AdmonitionImportant AdmonitionType = "important" AdmonitionWarning AdmonitionType = "warning" AdmonitionCaution AdmonitionType = "caution" )
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) GetHTMLConfig ¶
func (b *Builder) GetHTMLConfig() *preprocessors.HTMLConfig
GetHTMLConfig returns the HTML-specific config for preprocessors
func (*Builder) LiveReload ¶
func (*Builder) ShouldBuildIndex ¶
type Config ¶
type Config struct {
AdditionalJS []string `toml:"additional-js"`
AdditionalCss []string `toml:"additional-css"`
GitRepositoryURL string `toml:"git-repository-url"`
GitRepositoryIcon string `toml:"git-repository-icon"`
EditURLTemplate string `toml:"edit-url-template"`
Theme string `toml:"theme"`
SiteURL string `toml:"site-url"`
CName string `toml:"cname"`
Input404 string `toml:"input-404"`
Logo string `toml:"logo"`
Favicon string `toml:"favicon"`
Redirect map[string]string
SmartPunctuation bool `toml:"smart-punctuation"`
MathJaxSupport bool `toml:"mathjax-support"`
D2Support bool `toml:"d2-support"`
HighlightType string `toml:"highlight-type"`
HighlightTheme string `toml:"highlight-theme"`
SourceURLTemplate string `toml:"source-url-template"`
IncludeLineNumbers bool `toml:"include-line-numbers"`
IncludeContextLines int `toml:"include-context-lines"`
}
type GoldmarkConfig ¶
type GoldmarkConfig struct {
MathJaxSupport bool
HighlightType string
HighlightTheme string
D2Support bool
SmartPunctuation bool
// PathResolver returns the base path for resolving relative image paths
PathResolver func() string
}
GoldmarkConfig holds configuration for creating a goldmark instance