Documentation
¶
Index ¶
- Constants
- Variables
- func FindHtmlIds(r io.Reader) ([]string, error)
- func NewAutoIds(parser goldmark.Markdown, id_type string, sys_ids []string) (parser.IDs, error)
- func NewGfmIDs(p goldmark.Markdown, sys_ids []string) parser.IDs
- func NewParserExts(mc *MdConfig) []goldmark.Extender
- func NewSafeIDs(p goldmark.Markdown, sys_ids []string) parser.IDs
- type AlertTitleMapping
- type AlertsOptions
- type AudioOpt
- type AutoIdsOptions
- type CustomPageConfig
- type CustomParam
- type CustomParamConfig
- type EmbedOptions
- type EmbedRules
- type EmojiConfig
- type EmojiMapping
- type EmojiOptions
- type ExtFlags
- type FootnoteOptions
- type FrontMatterConfig
- type FrontMatterParam
- type GfmIDs
- type Head
- type IframeOpt
- type Link
- type LinkMenuConfig
- type Md2Html
- type Md2HtmlConfig
- type MdConfig
- type PrintPaperConfig
- type PrintPaperMapping
- type SafeIDs
- type SmCardConfig
- type SmCardParam
- type Toc
- type UnmarshalFunc
- type VideoOpt
Constants ¶
View Source
const CatsSeriesName = "cats"
Variables ¶
View Source
var AutoIdsMap = map[string]func(parser goldmark.Markdown, sys_ids []string) parser.IDs{}
View Source
var ErrBadAutoIdsType = errors.New("bad auto IDs type")
View Source
var ErrInvalidFrontMatter = errors.New("invalid front matter")
View Source
var ErrInvalidSmCardParam = errors.New("invalid sm_card_config parameter")
Functions ¶
func NewAutoIds ¶ added in v1.20250513.0
func NewParserExts ¶ added in v1.20250513.0
Types ¶
type AlertTitleMapping ¶ added in v1.20250513.0
type AlertTitleMapping alerts.TitleHtmlMapping
func (*AlertTitleMapping) Initialize ¶ added in v1.20250513.0
func (ppm *AlertTitleMapping) Initialize()
func (*AlertTitleMapping) MakeNew ¶ added in v1.20250513.0
func (_ *AlertTitleMapping) MakeNew() *AlertTitleMapping
func (*AlertTitleMapping) UnmarshalTOML ¶ added in v1.20250513.0
func (thm *AlertTitleMapping) UnmarshalTOML(decode func(interface{}) error) error
type AlertsOptions ¶ added in v1.20250513.0
type AlertsOptions struct {
TitleMapping upath.Import[*AlertTitleMapping] `toml:",omitempty"`
}
type AudioOpt ¶
type AudioOpt struct {
SiteId string
Host string
Path string `toml:",omitempty"`
Regex *regexp.Regexp `toml:",omitempty"`
}
func (*AudioOpt) UnmarshalTOML ¶
type AutoIdsOptions ¶
type AutoIdsOptions struct {
Type string `toml:",omitempty"`
}
type CustomPageConfig ¶ added in v1.20250513.0
type CustomPageConfig struct {
FrontMatter FrontMatterConfig `toml:",omitempty"`
SmCard SmCardConfig `toml:",omitempty"`
LinkMenu LinkMenuConfig `toml:",omitempty"`
PrintPaper PrintPaperConfig `toml:",omitempty"`
CustomParam CustomParamConfig `toml:",omitempty"`
PageStyle string `toml:",omitempty"`
// contains filtered or unexported fields
}
func (*CustomPageConfig) Initialize ¶ added in v1.20250513.0
func (cpc *CustomPageConfig) Initialize()
func (*CustomPageConfig) MakeNew ¶ added in v1.20250513.0
func (_ *CustomPageConfig) MakeNew() *CustomPageConfig
func (*CustomPageConfig) UnmarshalTOML ¶ added in v1.20250513.0
func (cpc *CustomPageConfig) UnmarshalTOML(decode func(interface{}) error) error
type CustomParam ¶ added in v1.20250513.0
type CustomParamConfig ¶ added in v1.20250513.0
type CustomParamConfig struct {
Default CustomParam `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 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"`
Alerts bool `toml:",omitempty"`
}
type FootnoteOptions ¶
type FootnoteOptions struct {
BacklinkHTML string `toml:",omitempty"`
}
type FrontMatterConfig ¶ added in v1.20250513.0
type FrontMatterConfig struct {
Yaml bool `toml:",omitempty"`
Toml bool `toml:",omitempty"`
Json bool `toml:",omitempty"`
UsedForHtml bool `toml:",omitempty"`
UsedForText bool `toml:",omitempty"`
}
func (*FrontMatterConfig) IsEnabled ¶ added in v1.20250513.0
func (fmc *FrontMatterConfig) IsEnabled() bool
func (*FrontMatterConfig) TrimAndParse ¶ added in v1.20250513.0
func (fmc *FrontMatterConfig) TrimAndParse(bin []byte) ([]byte, *FrontMatterParam, error)
type FrontMatterParam ¶ added in v1.20250513.0
type FrontMatterParam struct {
Product string `yaml:"product,omitempty" toml:"product,omitempty" json:"product,omitempty"`
Title string `yaml:"title,omitempty" toml:"title,omitempty" json:"title,omitempty"`
MarkdownConfig string `yaml:"markdown_config,omitempty" toml:"markdown_config,omitempty" json:"markdown_config,omitempty"`
ThemeStyle string `yaml:"theme_style,omitempty" toml:"theme_style,omitempty" json:"theme_style,omitempty"`
PageStyle string `yaml:"page_style,omitempty" toml:"page_style,omitempty" json:"page_style,omitempty"`
DirectoryViewMode string `yaml:"directory_view_mode,omitempty" toml:"directory_view_mode,omitempty" json:"directory_view_mode,omitempty"`
PaperType string `yaml:"paper_type,omitempty" toml:"paper_type,omitempty" json:"paper_type,omitempty"`
PrintZoom float32 `yaml:"print_zoom,omitempty" toml:"print_zoom,omitempty" json:"print_zoom,omitempty"`
SmCard SmCardParam `yaml:"sm_card,omitempty" toml:"sm_card,omitempty" json:"sm_card,omitempty"`
CustomParam CustomParam `yaml:"custom_param,omitempty" toml:"custom_param,omitempty" json:"custom_param,omitempty"`
LinkMenu []Link `yaml:"link_menu,omitempty" toml:"link_menu,omitempty" json:"link_menu,omitempty"`
Config *FrontMatterConfig `yaml:"-" toml:"-" json:"-"`
}
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 ¶
type Link ¶ added in v1.20250513.0
type Link struct {
Label string `yaml:"label,omitempty" toml:"label,omitempty" json:"label,omitempty"`
Url string `yaml:"url,omitempty" toml:"url,omitempty" json:"url,omitempty"`
}
func (*Link) UnmarshalTOML ¶ added in v1.20250513.0
func (*Link) UnmarshalYAML ¶ added in v1.20250513.0
type LinkMenuConfig ¶ added in v1.20250513.0
type LinkMenuConfig struct {
Default []Link `toml:",omitempty"`
}
type Md2Html ¶
type Md2Html struct {
// contains filtered or unexported fields
}
func NewMd2Html ¶
func NewMd2Html(cfg *Md2HtmlConfig) *Md2Html
type Md2HtmlConfig ¶ added in v1.20250729.0
type MdConfig ¶
type MdConfig struct {
Extension ExtFlags
AutoIds AutoIdsOptions `toml:",omitempty"`
Footnote FootnoteOptions `toml:",omitempty"`
Emoji EmojiOptions `toml:",omitempty"`
Embed EmbedOptions `toml:",omitempty"`
Alerts AlertsOptions `toml:",omitempty"`
ModTime time.Time `toml:"-"`
// contains filtered or unexported fields
}
func NewMdConfig ¶ added in v1.20250513.0
func NewMdConfigDefault ¶
func NewMdConfigDefault() *MdConfig
func (*MdConfig) Initialize ¶
func (mc *MdConfig) Initialize()
func (*MdConfig) UnmarshalTOML ¶
type PrintPaperConfig ¶ added in v1.20250513.0
type PrintPaperConfig struct {
Mapping upath.Import[*PrintPaperMapping] `toml:",omitempty"`
Default struct {
PaperType string `toml:",omitempty"`
PrintZoom float32 `toml:",omitempty"`
} `toml:",omitempty"`
}
type PrintPaperMapping ¶ added in v1.20250513.0
func (*PrintPaperMapping) GetCss ¶ added in v1.20250513.0
func (ppm *PrintPaperMapping) GetCss(name string) (string, bool)
func (*PrintPaperMapping) Initialize ¶ added in v1.20250513.0
func (ppm *PrintPaperMapping) Initialize()
func (*PrintPaperMapping) MakeNew ¶ added in v1.20250513.0
func (_ *PrintPaperMapping) MakeNew() *PrintPaperMapping
func (*PrintPaperMapping) UnmarshalTOML ¶ added in v1.20250513.0
func (ppm *PrintPaperMapping) UnmarshalTOML(decode func(interface{}) error) error
type SmCardConfig ¶ added in v1.20250513.0
type SmCardConfig struct {
Enabled bool `toml:",omitempty"`
SiteTopUrl string `toml:",omitempty"`
Default struct {
Image string `toml:",omitempty"`
UseXcomLarge bool `toml:",omitempty"`
Description string `toml:",omitempty"`
SiteName string `toml:",omitempty"`
SiteXcomId string `toml:",omitempty"`
CreatorXcomId string `toml:",omitempty"`
}
}
func (*SmCardConfig) UnmarshalTOML ¶ added in v1.20250513.0
func (scc *SmCardConfig) UnmarshalTOML(decode func(interface{}) error) error
type SmCardParam ¶ added in v1.20250513.0
type SmCardParam struct {
Description string `yaml:"description" toml:"description" json:"description"`
Image string `yaml:"image,omitempty" toml:"image,omitempty" json:"image,omitempty"`
UseXcomLarge bool `yaml:"is_large,omitempty" toml:"card_type,omitempty" json:"card_type,omitempty"`
Alt string `yaml:"alt,omitempty" toml:"alt,omitempty" json:"alt,omitempty"`
Title string `yaml:"title,omitempty" toml:"title,omitempty" json:"title,omitempty"`
SiteName string `yaml:"site_name,omitempty" toml:"site_name,omitempty" json:"site_name,omitempty"`
SiteUrl string `yaml:"site_url,omitempty" toml:"site_url,omitempty" json:"site_url,omitempty"`
SiteXcomId string `yaml:"site_xcom_id,omitempty" toml:"site_xcom_id,omitempty" json:"site_xcom_id,omitempty"`
CreatorXcomId string `yaml:"creator_xcom_id,omitempty" toml:"creator_xcom_id,omitempty" json:"creator_xcom_id,omitempty"`
}
func (*SmCardParam) Fix ¶ added in v1.20250513.0
func (scp *SmCardParam) Fix(scc *SmCardConfig, abs_cur string)
type Toc ¶
func (*Toc) ConvertHtml ¶
type UnmarshalFunc ¶ added in v1.20250513.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.