Add fuzzy search to web docs.

This commit is contained in:
Brenden Matthews
2022-10-01 15:32:01 -05:00
committed by Brenden Matthews
parent 7f47b5f94e
commit 6f5a74c903
13 changed files with 347 additions and 63 deletions

View File

@@ -11,11 +11,13 @@ const DOC_PATH = path.join(process.cwd(), '..', 'doc')
export interface Documentation {
desc: string
desc_md: string
values: DocItem[]
}
export interface DocItem {
name: string
desc: string
desc_md: string
default: string | undefined
args: string[]
}
@@ -27,8 +29,12 @@ function getDocumentation(source: string): Documentation {
)
const parsed = yaml.load(configSettingsFile.toString()) as Documentation
const docs = {
desc: processMarkdown(parsed.desc),
values: parsed.values.map((c) => ({ ...c, desc: processMarkdown(c.desc) })),
...parsed,
desc_md: processMarkdown(parsed.desc),
values: parsed.values.map((c) => ({
...c,
desc_md: processMarkdown(c.desc),
})),
}
return docs