Documentation
¶
Index ¶
Constants ¶
const AssetPrefix = "/docs/"
AssetPrefix is where the dashboard serves the images the docs reference.
const RoutePrefix = "#docs/"
RoutePrefix is the dashboard hash route a documentation page lives at.
Variables ¶
This section is empty.
Functions ¶
func AssetURL ¶
AssetURL rewrites a file reference in the docs into the URL the binary serves it from. Site-absolute paths keep their shape under the prefix, relative ones resolve against the page's section.
func Normalize ¶
Normalize rewrites the VitePress-flavoured markdown under docs/ into portable markdown. Containers become blockquotes, code-group fence labels become a bold line above their block, and the inline HTML VitePress needs to escape template braces becomes a code span, so a plain CommonMark renderer shows the page instead of leaking the syntax. Both `lerd man` and the dashboard read it.
func PageHref ¶
PageHref rewrites a link between documentation pages into the dashboard route that shows it. Anchors survive, and an image or download link keeps pointing at the served file.
func RenderHTML ¶
RenderHTML renders a page to an HTML fragment for the dashboard. Links between pages become dashboard routes and images become URLs the binary serves, so a reader never leaves the machine. Raw HTML is dropped rather than emitted.
func SectionLabel ¶
SectionLabel returns the display name for a section key.
Types ¶
type Page ¶
type Page struct {
Title string
Section string
Slug string
Path string
// contains filtered or unexported fields
}
Page represents a single documentation page.
func BuildRegistry ¶
func BuildRegistry() []Page
BuildRegistry walks the embedded docs FS and returns all pages in section order.
func FilterPages ¶
FilterPages returns pages whose title or content contains the filter string (case-insensitive).