From 35acea733229b07074268881c0eac521f6a2a3c9 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Fri, 29 Jul 2022 23:50:22 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20API=20`=E6=B8=B2=E6=9F=93=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF`=20=E6=96=87=E6=A1=A3=E6=8F=8F=E8=BF=B0=20Fix=20https?= =?UTF-8?q?://github.com/siyuan-note/siyuan/issues/5538?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API.md | 24 +++++++++++++++++++++++- API_zh_CN.md | 26 ++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index 19d5744c6..2fe9cf6fe 100644 --- a/API.md +++ b/API.md @@ -808,7 +808,29 @@ View API token in Settings - About, request header: `Authorization: T ### Render a template -/api/template/render +* `/api/template/render` +* Parameters + + ```json + { + "id": "20220724223548-j6g0o87", + "path": "F:\\SiYuan\\data\\templates\\foo.md" + } + ``` + * `id`: The ID of the document where the rendering is called + * `path`: Template file absolute path +* Return value + + ```json + { + "code": 0, + "msg": "", + "data": { + "content": "
foo
", + "path": "F:\\SiYuan\\data\\templates\\foo.md" + } + } + ``` ## File diff --git a/API_zh_CN.md b/API_zh_CN.md index 9d10defb6..7d907090c 100644 --- a/API_zh_CN.md +++ b/API_zh_CN.md @@ -703,7 +703,7 @@ } ``` - * `id`:待获取块的 ID + * `id`:待获取块的 ID * 返回值 ```json @@ -803,7 +803,29 @@ ### 渲染模板 -/api/template/render +* `/api/template/render` +* 参数 + + ```json + { + "id": "20220724223548-j6g0o87", + "path": "F:\\SiYuan\\data\\templates\\foo.md" + } + ``` + * `id`:调用渲染所在的文档 ID + * `path`:模板文件绝对路径 +* 返回值 + + ```json + { + "code": 0, + "msg": "", + "data": { + "content": "
foo
", + "path": "F:\\SiYuan\\data\\templates\\foo.md" + } + } + ``` ## 文件