Elffuss BraidHub

kikocis/continue public

9df136a0123e · 3.1 KiBRenderedRawPermalink
1---
2description: 了解如何在 Continue 中访问和搜索你的项目文档
3keywords: [文档, 索引, 上下文提供者, 嵌入, 文档]
4toc_max_heading_level: 5
5---
6
7# @Docs
8
9[`@Docs` 上下文提供者](http://localhost:3000/customization/context-providers#documentation) 允许你直接通过 Continue 与自己的文档交互。这个特性运行你索引任何静态网站或 Github markdown 页面,让你在编码时访问和利用你的文档更方便。
10
11## 启用 `@Docs` 上下文提供者
12
13为了启用 `@Docs` 上下文提供者,你需要添加它到你的 `config.json` 文件中的上下文提供者列表。
14
15```json
16{
17 "contextProviders": [
18 {
19 "name": "docs"
20 }
21 ]
22}
23```
24
25## 它是如何工作的
26
27`@Docs` 上下文提供者通过爬取指定的文档网站工作,生成嵌入,把它们保存再本地。这个过程允许快速有效地访问你的文档内容。
28
291. 我们爬取指定的文档网站
302. 生成内容的嵌入
313. 本地保存嵌入在你的机器上
324. 通过 `@Docs` 上下文提供者提供访问索引内容
33
34### 通过 `@Docs` 上下文提供者
35
36为了添加一个单独的文档网站,我们推荐使用 `@Docs` 上下文提供者。
37
381. 在聊天面板输入 `@Docs` ,点击回车
392. 输入 "add" 并选择 "Add Docs" 选项
403. 输入需要的信息到对话框
41
42索引将在提交之后开始。
43
44### 通过 `config.json`
45
46为了添加多个文档网站,我们推荐批量添加它们到你的 `config.json` 文件中。索引将在文件保存后开始。
47
48[docs 的配置 schema](https://github.com/continuedev/continue/blob/v0.9.212-vscode/extensions/vscode/config_schema.json#L1943-L1973) 如下:
49
50```json
51"docs": [
52 {
53 "title": "Continue",
54 "startUrl": "https://docs.continue.dev/intro",
55 "faviconUrl": "https://docs.continue.dev/favicon.ico",
56 }
57]
58```
59
60- `title`: 文档网站的名称,用来在 UI 中进行识别。
61- `startUrl`: 索引进程开始的 URL 。
62<!-- - `rootUrl`: 文档网站的基本 URL ,用来确定哪个页面索引。 -->
63- `faviconUrl`: 网站 favicon 的 URL ,用来在 UI 中进行视觉识别。
64
65## 使用 `useChromiumForDocsCrawling` 爬取动态生成的网站
66
67默认情况下,我们使用一个轻量的工具爬取文档网站,它不能渲染使用 JavaScript 动态生成的网站。
68
69If you want to crawl a site that is dynamically generated, or you get an error while attempting to crawl a site, you can enable the experimental `useChromiumForDocsCrawling` feature in your `config.json`. This will download and install Chromium to `~/.continue/.utils`.
70
71如果你想要爬取一个动态生成的网站,或者当你爬取网站时得到一个错误,你可以在你的 `config.json` 启用试验性的 `useChromiumForDocsCrawling` 特性。这将下载并安装 Chromium 到 `~/.continue/.utils` 。
72
73```json title="config.json"
74"experimental": {
75 "useChromiumForDocsCrawling": true
76}
77```
78
79## 常见问题
80
81### 索引内容多长时间更新?
82
83当前,我们没有自动地重新索引你的文档。如果你想要强制重新刷新,你可以使用下面的命令: `Continue: Docs Force Re-Index` 。