Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:memo: Clarify path separators in createDocWithMd API documentation

Danielee3244b99ced
diff --git a/docs/API.ja.md b/docs/API.ja.md
index 5f4598d495..08a4743b9c 100644
--- a/docs/API.ja.md
+++ b/docs/API.ja.md
@@ -382,7 +382,10 @@ if (response.code === 0 && response.data) {
```
* `notebook`: ノートブックID
- * `path`: ドキュメントパス、/で始まり/で階層を区切る(このpathはデータベースのhpathフィールドに対応)
+ * `path`: ドキュメントパス、`/` で始まり `/` で階層を区切る(データベースの `hpath` フィールドに対応)
+ * `/` は階層の区切り文字であり、ドキュメントタイトル内のスラッシュを表すことはできない。存在しない親ドキュメントは自動的に作成される
+ * 例えば、`/Notes/Programming in C/C++` は、`Notes` の下にある `Programming in C` の下に、タイトルが `C++` のドキュメントを作成する
+ * インポート処理では、各タイトルを処理してからパスを組み立てること。例えば、ASCII の `/` を全角の `/`(U+FF0F)に置き換えると、`/Notes/Programming in C/C++` は `Notes` の下にタイトルが `Programming in C/C++` のドキュメントを作成する。この置換はタイトルの文字列を変更する
* `markdown`: GFM Markdownコンテンツ
* 戻り値
diff --git a/docs/API.md b/docs/API.md
index e622b0ebe6..bebc8bddc1 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -387,8 +387,10 @@ The close endpoint validates the notebook ID without trimming whitespace. Typed
```
* `notebook`: Notebook ID
- * `path`: Document path, which needs to start with / and separate levels with / (path here corresponds to the
- database hpath field)
+ * `path`: Document path, which needs to start with `/` and separate levels with `/` (corresponds to the database `hpath` field)
+ * `/` is a hierarchy separator and cannot represent a literal slash in a document title; missing parent documents are created automatically
+ * For example, `/Notes/Programming in C/C++` creates a document titled `C++` under `Programming in C` under `Notes`
+ * Importers should sanitize each title before joining titles into a path, for example by replacing ASCII `/` with full-width `/` (U+FF0F): `/Notes/Programming in C/C++` creates a document titled `Programming in C/C++` under `Notes`. This replacement changes the title text
* `markdown`: GFM Markdown content
* Return value
diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.md
index 903d416c04..dd096aa8bc 100644
--- a/docs/API.zh-CN.md
+++ b/docs/API.zh-CN.md
@@ -387,7 +387,10 @@ if (response.code === 0 && response.data) {
```
* `notebook`:笔记本 ID
- * `path`:文档路径,需要以 / 开头,中间使用 / 分隔层级(这里的 path 对应数据库 hpath 字段)
+ * `path`:文档路径,需要以 `/` 开头,中间使用 `/` 分隔层级(对应数据库 `hpath` 字段)
+ * `/` 是层级分隔符,不能表示文档标题中的斜杠;不存在的父文档会自动创建
+ * 例如,`/Notes/Programming in C/C++` 会在 `Notes` 下的 `Programming in C` 下创建标题为 `C++` 的文档
+ * 导入程序应在拼接路径前逐个处理标题,例如将 ASCII `/` 替换为全角 `/`(U+FF0F):`/Notes/Programming in C/C++` 会在 `Notes` 下创建标题为 `Programming in C/C++` 的文档。此替换会改变标题文本
* `markdown`:GFM Markdown 内容
* 返回值