Documentation
¶
Overview ¶
Package productdocs indexes the WeKnora documentation bundled with the server, so the built-in assistant can answer how the product works from the docs of the running version.
Index ¶
Constants ¶
const PublicBaseURL = "https://weknora.weixin.qq.com/docs/"
PublicBaseURL is where the documentation site serves these pages.
Variables ¶
var Categories = []Category{
{Dir: "01-getting-started", Label: "快速开始"},
{Dir: "02-architecture", Label: "架构"},
{Dir: "03-features", Label: "功能模块"},
{Dir: "04-api", Label: "API 参考"},
{Dir: "05-clients", Label: "客户端"},
{Dir: "06-development", Label: "开发指南"},
{Dir: "07-releases", Label: "版本发布"},
}
Categories are the documentation's sidebar groups, in site order. They mirror the sections list in website-docs/.vitepress/config.mts.
Functions ¶
func UnescapeAnchor ¶
UnescapeAnchor decodes a percent-encoded anchor, leaving one that is not valid encoding as given.
Types ¶
type Doc ¶
type Doc struct {
Path string // "03-features/14-wiki", the page's path under the site
Category string // Sidebar group, e.g. "功能模块"
Title string
Sections []*Section // In page order; the first is the text before any "##"
}
Doc is one documentation page.
type Library ¶
type Library struct {
// contains filtered or unexported fields
}
Library is a loaded, searchable set of pages.
func Default ¶
Default returns the library built from the pages embedded in the binary. As with Load, a non-nil library may come with an error naming the pages left out.
func Load ¶
Load parses every category's pages in fsys. A page that cannot be read or parsed is left out and reported in the error, alongside a library of the remaining pages, so one broken page does not take the others with it.
type Section ¶
type Section struct {
Doc *Doc
Anchor string // "" for the page's lead section
Heading string
Level int // 1 for the lead section, then 2 to maxSectionLevel
Parents []string // Headings of the enclosing sections, outermost first
Content string // Cleaned Markdown shown to the model
// contains filtered or unexported fields
}
Section is the text under one heading of level 2 to maxSectionLevel, up to the next such heading.