html

package
v0.0.0-...-1600309 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_BIND = "0.0.0.0:8003"
)

Variables

View Source
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

func NewMdBookIDs() parser.IDs

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 New

func New(live bool, sitemap []*sitemap.Entry, config *config.Config, logger zerolog.Logger) (*Builder, error)

func (*Builder) AddFiles

func (b *Builder) AddFiles() error

func (*Builder) BuildEntry

func (b *Builder) BuildEntry(entry *sitemap.Entry) error

func (*Builder) BuildIndex

func (b *Builder) BuildIndex(entries []*sitemap.Entry) error

func (*Builder) Close

func (b *Builder) Close() error

func (*Builder) GetHTMLConfig

func (b *Builder) GetHTMLConfig() *preprocessors.HTMLConfig

GetHTMLConfig returns the HTML-specific config for preprocessors

func (*Builder) LiveReload

func (b *Builder) LiveReload(version uint64)

func (*Builder) Name

func (b *Builder) Name() string

func (*Builder) Serve

func (b *Builder) Serve(args string, version *uint64) error

func (*Builder) ShouldBuildIndex

func (b *Builder) ShouldBuildIndex() bool

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"`
	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

type Tab

type Tab struct {
	Name       string
	Icon       string
	IconFamily string
	Link       string
	Active     bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL