Documentation
¶
Index ¶
- Variables
- func RuleConvertLinksToHTML(originalExt string) markdown.PostprocessRule
- func RuleFileTransclude(f fs.FS, basePath string) markdown.InlineRule
- func RuleStripLinkPrefix(prefix string) markdown.PostprocessRule
- type Capsule
- func (c *Capsule) Build(prod bool) error
- func (c *Capsule) Close() error
- func (c *Capsule) IgnorePath(path string, isDir bool) bool
- func (c *Capsule) RuleAddHeadingLinks(s *markdown.StateBlock, _ int, _ int, _ bool) bool
- func (c *Capsule) RuleExtractTitle(s *markdown.StateBlock, _, _ int, _ bool) bool
- func (c *Capsule) RuleFancyImages(s *markdown.StateInline)
- func (c *Capsule) RuleSyntaxHighlightPre(s *markdown.StateBlock, _ int, _ int, _ bool) bool
- type Config
- type FlatTree
- type Img
- type Link
- type Metadata
- type Node
- type Toc
- type TocHeading
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AppVersion = "(devel)" AppName = "SourceHut Wiki" AppRepoURL = "https://git.sr.ht/~mariusor/staticman" )
View Source
var ( DefaultSiteConfig = pages.SiteConfig{ NotFound: &defaultNotFound, FileConfigs: []pages.FileConfig{ { Glob: "*.png", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.jpg", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.avif", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.js", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.svg", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.css", Options: pages.FileOptions{ CacheControl: &defaultStaticMaxAgeValue, }, }, { Glob: "*.html", Options: pages.FileOptions{ CacheControl: &defaultHTMLMaxAgeValue, }, }, { Glob: "*.ico", Options: pages.FileOptions{ CacheControl: &defaultHTMLMaxAgeValue, }, }, }, } )
Functions ¶
func RuleConvertLinksToHTML ¶
func RuleConvertLinksToHTML(originalExt string) markdown.PostprocessRule
func RuleFileTransclude ¶
func RuleFileTransclude(f fs.FS, basePath string) markdown.InlineRule
RuleFileTransclude parses the lines for transclude atoms These have the format !(./path/to/filename.md)
func RuleStripLinkPrefix ¶
func RuleStripLinkPrefix(prefix string) markdown.PostprocessRule
Types ¶
type Capsule ¶
type Capsule struct {
// Toc contains the structure of the current site:
// link -> { title, link, Headings {title, link} }
Toc Toc
Repo *git.Repository
Root *os.Root
Target *os.Root
Images []Img
Licenses []string
Tree FlatTree
Indexes []indexDocument
Ignore []gitignore.Pattern
// contains filtered or unexported fields
}
func InitCapsule ¶
func (*Capsule) RuleAddHeadingLinks ¶
func (*Capsule) RuleExtractTitle ¶
func (*Capsule) RuleFancyImages ¶
func (c *Capsule) RuleFancyImages(s *markdown.StateInline)
func (*Capsule) RuleSyntaxHighlightPre ¶
type Img ¶
type Toc ¶
type Toc []*TocHeading
func (*Toc) Add ¶
func (t *Toc) Add(el TocHeading)
func (*Toc) Contains ¶
func (t *Toc) Contains(el TocHeading) bool
func (*Toc) ForLink ¶
func (t *Toc) ForLink(link string) *TocHeading
func (*Toc) SetCurrent ¶
type TocHeading ¶
type TocHeading struct {
Title string
Open bool
Link string
Level int
Crumbs Toc
Tags []string
Words []string
Headings Toc
// contains filtered or unexported fields
}
func (*TocHeading) Add ¶
func (t *TocHeading) Add(toc TocHeading)
func (*TocHeading) Type ¶
func (t *TocHeading) Type() template.HTMLAttr
Source Files
¶
Click to show internal directories.
Click to hide internal directories.