dsh-doc-preview 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cordis.patch.yml +2 -2
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ http://<host>/docs/<工作区id>/<相对路径>.md -> 渲染该工作区内的
|
|
|
18
18
|
|
|
19
19
|
| 工作区目录 | 工作区 id | 示例地址 |
|
|
20
20
|
|---|---|---|
|
|
21
|
-
| `/
|
|
22
|
-
| `/
|
|
21
|
+
| `/Users/alice/work/project` | `Users-alice-work-project` | `/docs/Users-alice-work-project/docs/调研.md` |
|
|
22
|
+
| `/Users/alice/work/reports` | `Users-alice-work-reports` | `/docs/Users-alice-work-reports/报告.md` |
|
|
23
23
|
|
|
24
24
|
- 工作区列表来自 `ctx.workspaceRegistry.list()`(持久化于 `storages/workspace.json`),**新登记的工作区自动出现**,无需改插件。
|
|
25
25
|
- **隔离**:请求被限制在对应工作区目录内;未知工作区、路径穿越(`..`)、畸形多斜杠一律 404。
|
package/cordis.patch.yml
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
# /docs/ -> index of registered workspaces
|
|
14
14
|
# /docs/<workspaceId>/<rel> -> confined to that workspace directory
|
|
15
15
|
# workspaceId = workspace path with leading "/" dropped and "/" -> "-",
|
|
16
|
-
# e.g. /
|
|
17
|
-
# Example: /docs/
|
|
16
|
+
# e.g. /Users/alice/work/project -> Users-alice-work-project.
|
|
17
|
+
# Example: /docs/Users-alice-work-project/docs/调研.md
|
package/lib/index.js
CHANGED
|
@@ -211,7 +211,7 @@ function page(title, body) {
|
|
|
211
211
|
* /docs/<workspaceId>/ -> directory listing of that workspace root
|
|
212
212
|
* /docs/<workspaceId>/<rel>.md -> rendered doc
|
|
213
213
|
* `<workspaceId>` is the workspace path with the leading "/" removed and "/"
|
|
214
|
-
* replaced by "-" (e.g. /
|
|
214
|
+
* replaced by "-" (e.g. /Users/alice/work/project -> Users-alice-work-project),
|
|
215
215
|
* derived from ctx.workspaceRegistry.list(). Only registered workspaces
|
|
216
216
|
* resolve; each request is confined to that workspace's directory.
|
|
217
217
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-doc-preview",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A dsh bundle plugin: preview local Markdown/HTML documents per workspace in the Web GUI via a /docs route on ctx.webServer + ctx.workspaceRegistry.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|