Skip to content

Commit f80909d

Browse files
authored
docs: Host pre-aggregated LLM knowledge files (#1355)
1 parent d5b2503 commit f80909d

File tree

6 files changed

+135
-13
lines changed

6 files changed

+135
-13
lines changed

docs/.vitepress/config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { version as i18nVersion } from '../../packages/i18n/package.json';
1414
import { version as autoIconsVersion } from '../../packages/auto-icons/package.json';
1515
import { version as unocssVersion } from '../../packages/unocss/package.json';
1616
import { version as storageVersion } from '../../packages/storage/package.json';
17+
import knowledge from 'vitepress-knowledge';
1718

1819
const title = 'Next-gen Web Extension Framework';
1920
const titleSuffix = ' – WXT';
@@ -25,6 +26,16 @@ const ogImage = 'https://wxt.dev/social-preview.png';
2526

2627
// https://vitepress.dev/reference/site-config
2728
export default defineConfig({
29+
extends: knowledge({
30+
paths: {
31+
'/': 'docs',
32+
'/api/': 'api-reference',
33+
},
34+
pageSelectors: {
35+
'examples.md': '#VPContent > .VPPage',
36+
},
37+
}),
38+
2839
titleTemplate: `:title${titleSuffix}`,
2940
title: 'WXT',
3041
description,

docs/.vitepress/utils/menus.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ export function menuRoot(items: SidebarItem[]) {
2828
export function menuGroup(
2929
text: string,
3030
items: SidebarItem[],
31-
collapsable?: boolean,
31+
collapsible?: boolean,
3232
): SidebarItem;
3333
export function menuGroup(
3434
text: string,
3535
base: string,
3636
items: SidebarItem[],
37-
collapsable?: boolean,
37+
collapsible?: boolean,
3838
): SidebarItem;
3939
export function menuGroup(
4040
text: string,

docs/guide/resources/faq.md

+8
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,11 @@ This is usually caused by one of two things (or both) when using `createShadowRo
164164
Both issues have the same cause: the library puts something outside the `ShadowRoot`, and the `ShadowRoot`'s isolation prevents CSS from being applied to your UI.
165165

166166
Both issues have the same fix: tell the library to put elements inside the `ShadowRoot`, not outside it. See the details above for more information and example fixes for each problem.
167+
168+
## Is there an LLM trained on WXT's docs that I chat with?
169+
170+
Not yet, but we're working on it. For now, https://wxt.dev hosts pre-aggregated and pre-formatted knowledge files containing all the docs from this website:
171+
172+
- Index listing available knowledge files: https://wxt.dev/.wellknown/knowledge/index.json
173+
174+
You don't need to crawl the entire website, these files already contain all the relevant docs for training a LLM on WXT. But feel free to crawl it and generate your own files if you want!

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"typedoc-vitepress-theme": "1.0.0-next.3",
4040
"typescript": "^5.6.3",
4141
"vitepress": "^1.5.0",
42+
"vitepress-knowledge": "^0.3.0",
4243
"vitest-mock-extended": "^2.0.2",
4344
"vue": "^3.5.12",
4445
"wxt": "workspace:*"

packages/wxt/src/core/utils/__tests__/content-scripts.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('Content Script Utils', () => {
1111
it('should return a string containing all the options with defaults applied', () => {
1212
const hash = hashContentScriptOptions({ matches: [] });
1313

14-
expect(hash).toMatchInlineSnapshot(
15-
`"[["all_frames",false],["exclude_globs",[]],["exclude_matches",[]],["include_globs",[]],["match_about_blank",false],["match_origin_as_fallback",false],["matches",[]],["run_at","document_idle"],["world","ISOLATED"]]"`,
14+
expect(hash).toEqual(
15+
'[["all_frames",false],["exclude_globs",[]],["exclude_matches",[]],["include_globs",[]],["match_about_blank",false],["match_origin_as_fallback",false],["matches",[]],["run_at","document_idle"],["world","ISOLATED"]]',
1616
);
1717
});
1818

pnpm-lock.yaml

+111-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)