Documentation
¶
Index ¶
- Constants
- Variables
- func IgnorePath(ignore []gitignore.Pattern, path string, isDir bool) bool
- func RuleFileTransclude(f fs.FS) markdown.InlineRule
- func RuleFootnotes(s *markdown.StateCore)
- func RuleInlineCheckbox(s *markdown.StateInline, silent bool) bool
- func XDGCachePath(appName string) string
- func XDGDataPaths(appName string) string
- type Capsule
- type Config
- type FlatTree
- type Img
- type Link
- type Metadata
- type Node
- type Targeter
- type Toc
- type TocHeading
Constants ¶
View Source
const LevelTrace = slog.Level(-12)
View Source
const Sep = string(filepath.Separator)
Variables ¶
View Source
var ( AppVersion = "(devel)" AppName = "SourceHut Wiki" AppRepoURL = "https://git.sr.ht/~mariusor/staticman" AppBinary = "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: "*.json", 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, }, }, { Glob: ".status", Options: pages.FileOptions{ CacheControl: &noCache, }, }, }, } )
Functions ¶
func RuleFileTransclude ¶
func RuleFileTransclude(f fs.FS) markdown.InlineRule
RuleFileTransclude parses the lines for transclude atoms These have the format !(./path/to/filename.md)
func RuleFootnotes ¶
RuleFootnotes recognizes Markdown type footnotes with the following logic: [^1] -> <a href="#fn-foot-1" id="fn-inline-1"><sup>1</sup></a> [^1]: description -> <dt id="fn-foot-1">1</dt><dd>description<a href="#fn-inline-1">(back)</a></dd>
func RuleInlineCheckbox ¶
func RuleInlineCheckbox(s *markdown.StateInline, silent bool) bool
RuleInlineCheckbox converts Markdown type checkboxes into HTML ones [ ] -> <input type="checkbox" /> [-] -> <input type="checkbox" checked disabled class="indeterminate"/> [.] -> <input type="checkbox" disabled /> [x] -> <input type="checkbox" checked />
func XDGCachePath ¶
func XDGDataPaths ¶
Types ¶
type Node ¶
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
type TocHeading ¶
type TocHeading struct {
Link
Next string
Prev string
Level int
Crumbs Toc
Tags []string
Headings Toc
// contains filtered or unexported fields
}
func (*TocHeading) Add ¶
func (t *TocHeading) Add(toc TocHeading)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
