md2html

package
v1.20240717.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoIdsMap = map[string]func() parser.IDs{"": NewSafeIDs}
View Source
var ErrBadAutoIdsType = errors.New("bad auto IDs type")

Functions

func NewGfmIDs

func NewGfmIDs() parser.IDs

func NewSafeIDs

func NewSafeIDs() parser.IDs

Types

type AudioOpt

type AudioOpt struct {
	SiteId string
	Host   string
	Path   string         `toml:",omitempty"`
	Regex  *regexp.Regexp `toml:",omitempty"`
}

func (*AudioOpt) UnmarshalTOML

func (ao *AudioOpt) UnmarshalTOML(decode func(interface{}) error) error

type AutoIdsOptions

type AutoIdsOptions struct {
	Type string `toml:",omitempty"`
}

type EmbedOptions

type EmbedOptions struct {
	Rules upath.Import[*EmbedRules] `toml:",omitempty"`
}

type EmbedRules

type EmbedRules struct {
	AudioExt []string    `toml:",omitempty"`
	VideoExt []string    `toml:",omitempty"`
	Video    []VideoOpt  `toml:",omitempty"`
	Audio    []AudioOpt  `toml:",omitempty"`
	Iframe   []IframeOpt `toml:",omitempty"`
	// contains filtered or unexported fields
}

func (*EmbedRules) Initialize

func (er *EmbedRules) Initialize()

func (*EmbedRules) IsZero

func (er *EmbedRules) IsZero() bool

func (*EmbedRules) MakeNew

func (_ *EmbedRules) MakeNew() *EmbedRules

func (*EmbedRules) UnmarshalTOML

func (er *EmbedRules) UnmarshalTOML(decode func(interface{}) error) error

type EmojiConfig

type EmojiConfig struct {
	Emoji   string
	Aliases []string
	// contains filtered or unexported fields
}

type EmojiMapping

type EmojiMapping map[string]*EmojiConfig

func (*EmojiMapping) Initialize

func (em *EmojiMapping) Initialize()

func (*EmojiMapping) MakeNew

func (_ *EmojiMapping) MakeNew() *EmojiMapping

func (*EmojiMapping) UnmarshalTOML

func (em *EmojiMapping) UnmarshalTOML(decode func(interface{}) error) error

type EmojiOptions

type EmojiOptions struct {
	Mapping upath.Import[*EmojiMapping] `toml:",omitempty"`
}

type ExtFlags

type ExtFlags struct {
	Table          bool `toml:",omitempty"`
	Strikethrough  bool `toml:",omitempty"`
	TaskList       bool `toml:",omitempty"`
	DefinitionList bool `toml:",omitempty"`
	Footnote       bool `toml:",omitempty"`
	Autolinks      bool `toml:",omitempty"`
	Cjk            bool `toml:",omitempty"`
	Emoji          bool `toml:",omitempty"`
	Highlight      bool `toml:",omitempty"`
	Math           bool `toml:",omitempty"`
	Mermaid        bool `toml:",omitempty"`
	GeoMap         bool `toml:",omitempty"`
	Embed          bool `toml:",omitempty"`
}

type FootnoteOptions

type FootnoteOptions struct {
	BacklinkHTML string `toml:",omitempty"`
}

type GfmIDs

type GfmIDs struct {
	// contains filtered or unexported fields
}

func (*GfmIDs) Generate

func (ids *GfmIDs) Generate(value []byte, kind ast.NodeKind) []byte

func (*GfmIDs) Put

func (ids *GfmIDs) Put(value []byte)
type Head struct {
	Id    string
	Text  string
	Level int
}

type IframeOpt

type IframeOpt struct {
	SiteId string
	Host   string
	Type   string
	Path   string         `toml:",omitempty"`
	Query  string         `toml:",omitempty"`
	Regex  *regexp.Regexp `toml:",omitempty"`
	Player string
}

func (*IframeOpt) UnmarshalTOML

func (ifo *IframeOpt) UnmarshalTOML(decode func(interface{}) error) error

type Md2Html

type Md2Html struct {
	// contains filtered or unexported fields
}

func NewMd2Html

func NewMd2Html(mc *MdConfig) *Md2Html

func (*Md2Html) Convert

func (m2h *Md2Html) Convert(md []byte) ([]byte, []byte, []byte, error)

type MdConfig

type MdConfig struct {
	Extension ExtFlags
	AutoIds   AutoIdsOptions
	Footnote  FootnoteOptions
	Emoji     EmojiOptions
	Embed     EmbedOptions

	ModTime time.Time `toml:"-"`
	// contains filtered or unexported fields
}

func NewMdConfigDefault

func NewMdConfigDefault() *MdConfig

func (*MdConfig) Initialize

func (mc *MdConfig) Initialize()

func (*MdConfig) MakeNew

func (_ *MdConfig) MakeNew() *MdConfig

func (*MdConfig) UnmarshalTOML

func (mc *MdConfig) UnmarshalTOML(decode func(interface{}) error) error

type SafeIDs

type SafeIDs struct {
	// contains filtered or unexported fields
}

func (*SafeIDs) Generate

func (ids *SafeIDs) Generate(value []byte, kind ast.NodeKind) []byte

func (*SafeIDs) Put

func (ids *SafeIDs) Put(value []byte)

type Toc

type Toc struct {
	Title      string
	TitleLevel int
	Heads      []*Head
}

func NewToc

func NewToc(html_bin []byte) (*Toc, error)

func (*Toc) ConvertHtml

func (tc *Toc) ConvertHtml() []byte

type VideoOpt

type VideoOpt struct {
	SiteId string
	Host   string
	Path   string         `toml:",omitempty"`
	Regex  *regexp.Regexp `toml:",omitempty"`
}

func (*VideoOpt) UnmarshalTOML

func (vo *VideoOpt) UnmarshalTOML(decode func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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