Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-uni-app-x-zh
提交
37663c51
U
unidocs-uni-app-x-zh
项目概览
DCloud
/
unidocs-uni-app-x-zh
通知
164
Star
2
Fork
38
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
14
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-uni-app-x-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
14
合并请求
14
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
37663c51
编写于
5月 11, 2024
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: uts api json、uts com json
上级
72569ea1
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
17 deletion
+52
-17
docs/.vuepress/markdown/inject-json-to-md.js
docs/.vuepress/markdown/inject-json-to-md.js
+50
-15
docs/.vuepress/utils/utsApiJson.json
docs/.vuepress/utils/utsApiJson.json
+1
-1
docs/.vuepress/utils/utsComJson.json
docs/.vuepress/utils/utsComJson.json
+1
-1
未找到文件。
docs/.vuepress/markdown/inject-json-to-md.js
浏览文件 @
37663c51
...
...
@@ -50,100 +50,135 @@ function getRegExp(key) {
/**
*
* @param {string} text
* @returns {{match: RegExpMatchArray | null, json: {}}
* @returns {{match: RegExpMatchArray | null, json: {}
, regExp: RegExp | null
}
*/
const
getJSON
=
text
=>
{
let
match
=
text
.
match
(
getRegExp
(
'
CSSJSON
'
))
const
CSSJSONRegExp
=
getRegExp
(
'
CSSJSON
'
)
let
match
=
text
.
match
(
CSSJSONRegExp
)
CSSJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
cssJson
,
regExp
:
CSSJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
UTSJSON
'
))
const
UTSJSONRegExp
=
getRegExp
(
'
UTSJSON
'
)
match
=
text
.
match
(
UTSJSONRegExp
)
UTSJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
utsJson
,
regExp
:
UTSJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
UTSAPIJSON
'
))
const
UTSAPIJSONRegExp
=
getRegExp
(
'
UTSAPIJSON
'
)
match
=
text
.
match
(
UTSAPIJSONRegExp
)
UTSAPIJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
utsApiJson
,
regExp
:
UTSAPIJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
UTSCOMJSON
'
))
const
UTSCOMJSONRegExp
=
getRegExp
(
'
UTSCOMJSON
'
)
match
=
text
.
match
(
UTSCOMJSONRegExp
)
UTSCOMJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
utsComJson
,
regExp
:
UTSCOMJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
UTSUNICLOUDAPIJSON
'
))
const
UTSUNICLOUDAPIJSONRegExp
=
getRegExp
(
'
UTSUNICLOUDAPIJSON
'
)
match
=
text
.
match
(
UTSUNICLOUDAPIJSONRegExp
)
UTSUNICLOUDAPIJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
utsUnicloudApiJson
,
regExp
:
UTSUNICLOUDAPIJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
CUSTOMTYPEJSON
'
))
const
CUSTOMTYPEJSONRegExp
=
getRegExp
(
'
CUSTOMTYPEJSON
'
)
match
=
text
.
match
(
CUSTOMTYPEJSONRegExp
)
CUSTOMTYPEJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
customTypeJson
,
regExp
:
CUSTOMTYPEJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
VUEJSON
'
))
const
VUEJSONRegExp
=
getRegExp
(
'
VUEJSON
'
)
match
=
text
.
match
(
VUEJSONRegExp
)
VUEJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
vueJson
,
regExp
:
VUEJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
MANIFESTJSON
'
))
const
MANIFESTJSONRegExp
=
getRegExp
(
'
MANIFESTJSON
'
)
match
=
text
.
match
(
MANIFESTJSONRegExp
)
MANIFESTJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
manifestJson
,
regExp
:
MANIFESTJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
PAGESJSON
'
))
const
PAGESJSONRegExp
=
getRegExp
(
'
PAGESJSON
'
)
match
=
text
.
match
(
PAGESJSONRegExp
)
PAGESJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
pagesJson
,
regExp
:
PAGESJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
SPECIALSTRINGJSON
'
))
const
SPECIALSTRINGJSONRegExp
=
getRegExp
(
'
SPECIALSTRINGJSON
'
)
match
=
text
.
match
(
SPECIALSTRINGJSONRegExp
)
SPECIALSTRINGJSONRegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
specialStringJson
,
regExp
:
SPECIALSTRINGJSONRegExp
,
}
}
match
=
text
.
match
(
getRegExp
(
'
PAGEINSTANCE
'
))
const
PAGEINSTANCERegExp
=
getRegExp
(
'
PAGEINSTANCE
'
)
match
=
text
.
match
(
PAGEINSTANCERegExp
)
PAGEINSTANCERegExp
.
lastIndex
=
0
if
(
match
)
{
return
{
match
,
json
:
pageInstanceJson
,
regExp
:
PAGEINSTANCERegExp
,
}
}
return
{
match
:
null
,
json
:
{},
regExp
:
null
,
}
}
...
...
@@ -157,8 +192,8 @@ module.exports = md => {
for
(
let
index
=
0
;
index
<
lines
.
length
;
index
++
)
{
const
line
=
lines
[
index
]
const
{
match
,
json
}
=
getJSON
(
line
)
if
(
match
)
{
const
{
match
,
json
,
regExp
}
=
getJSON
(
line
)
if
(
match
&&
regExp
)
{
const
jsonPath
=
match
[
1
]
const
path
=
jsonPath
.
split
(
'
.
'
)
let
temp
=
json
...
...
@@ -167,7 +202,7 @@ module.exports = md => {
temp
=
temp
[
key
]
})
if
(
typeof
temp
===
'
undefined
'
)
continue
lines
[
index
]
=
temp
lines
[
index
]
=
lines
[
index
].
replace
(
regExp
,
temp
)
}
}
...
...
docs/.vuepress/utils/utsApiJson.json
浏览文件 @
37663c51
此差异已折叠。
点击以展开。
docs/.vuepress/utils/utsComJson.json
浏览文件 @
37663c51
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录