Skip to content

Commit 2eae485

Browse files
authored
JSONC highlighting & Upgrade VuePress (SocialSisterYi#1091)
* chore: upgrade vuepress & jsonc highlight * fix: broken links & wrong code type * chore: test for github action * chore(vuepress-deploy.yml): node 20 * fix(config.js): missing favicon * fix: try to fix memory limit * chore(vuepress-deploy.yml): remove running repo detection * chore: use github action workflows directly * fix(vuepress-deploy.yml): use '&&' not '&' * fix(vuepress-deploy.yml): contributors * feat: remove extra emojis * feat(CONTRIBUTING.md): remove extra emojis * feat(README.md): remove extra emoji * fix(live/message_stream.md): missing end tags * fix: plain text highlight * chore: upgrade * chore: upgrade * chore: upgrade vuepress to 2.0.0-rc.21 * chore: upgrade vuepress to 2.0.0-rc.23 * chore: upgrade vuepress to 2.0.0-rc.24 * chore: upgrade github action node version to 22
1 parent 2ecfe2a commit 2eae485

File tree

8 files changed

+2162
-1330
lines changed

8 files changed

+2162
-1330
lines changed
Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
name: deploy and pubish
1+
name: deploy and publish
2+
23
on: [push]
4+
5+
permissions:
6+
contents: read
7+
pages: write
8+
id-token: write
9+
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: false
13+
314
jobs:
415
build-and-deploy:
516
runs-on: ubuntu-latest
6-
if: github.repository == 'SocialSisterYi/bilibili-API-collect'
17+
# if: github.repository == 'SocialSisterYi/bilibili-API-collect'
718
steps:
819
- name: Checkout
9-
uses: actions/checkout@master
10-
11-
- name: vuepress-deploy
12-
uses: jenkey2011/vuepress-deploy@master
13-
env:
14-
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
15-
TARGET_REPO: SocialSisterYi/bilibili-API-collect
16-
TARGET_BRANCH: gh_pages
17-
BUILD_SCRIPT: yarn && yarn build
18-
BUILD_DIR: .vuepress/dist/
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
- name: Setup Node.js environment
24+
uses: actions/[email protected]
25+
with:
26+
node-version: 22
27+
cache: yarn
28+
- name: Build with yarn
29+
run: yarn && yarn build
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v5
32+
- name: Upload artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: '.vuepress/dist/'
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4

.vuepress/config.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
import { defaultTheme, defineUserConfig } from "vuepress";
1+
import { defineUserConfig } from "vuepress";
2+
import { viteBundler } from '@vuepress/bundler-vite'
3+
import { defaultTheme } from "@vuepress/theme-default";
24
import markdownItTaskLists from "markdown-it-task-lists";
3-
import { copyCodePlugin } from "vuepress-plugin-copy-code2";
45
import { searchPlugin } from "@vuepress/plugin-search";
6+
import { shikiPlugin } from '@vuepress/plugin-shiki'
7+
8+
const base = "/bilibili-API-collect/";
59

610
export default defineUserConfig({
7-
base: "/bilibili-API-collect/",
11+
bundler: viteBundler(),
12+
base: base,
813
lang: "zh-CN",
914
title: "BAC Document",
1015
description: "社区开源的第三方哔哩哔哩 API 文档",
11-
head: [["link", { rel: "icon", href: "/logo2.jpg" }]],
16+
head: [["link", { rel: "icon", href: base + "logo2.jpg" }]],
1217
locales: {
1318
"/": {
1419
lang: "zh-CN",
@@ -34,19 +39,26 @@ export default defineUserConfig({
3439
],
3540
},
3641
],
37-
sidebar: "auto",
3842
repo: "https://github.com/SocialSisterYi/bilibili-API-collect",
3943
docsBranch: "master",
4044
editLinkText: "在 GitHub 上编辑此页",
41-
colorMode: "auto"
45+
colorMode: "auto",
46+
themePlugins: {
47+
prismjs: false
48+
}
4249
}),
43-
plugins: [copyCodePlugin({}), searchPlugin({})],
44-
markdown: {
45-
code: {
46-
lineNumbers: true,
47-
},
48-
},
50+
plugins: [
51+
searchPlugin({}),
52+
shikiPlugin({
53+
theme: 'dark-plus',
54+
langs: [
55+
'javascript', 'typescript', 'markdown', 'protobuf', 'json', 'jsonc',
56+
'shell', 'go', 'html', 'http', 'java', 'kotlin', 'python', 'rust', 'c',
57+
'c++', 'cs', 'php', 'swift', 'text'
58+
]
59+
})
60+
],
4961
extendsMarkdown: (md) => {
5062
md.use(markdownItTaskLists);
51-
},
63+
}
5264
});

.vuepress/theme/layouts/Layout.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
</ParentLayout>
1414
</template>
1515

16+
<style>
17+
/* README.md */
18+
.shields a {
19+
margin: auto .25em;
20+
}
21+
.shields a::after {
22+
display: none !important;
23+
}
24+
</style>
25+
1626
<script setup>
1727
import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue';
1828
</script>

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@
3131
- QQ 交流群:[邀请链接](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ympvb3LAPT-Ulu3ezhGqbkJ8zXMKImOX&authKey=z1KdkOdKO3wytN43m9K6On9nBtnDL4pAoD6VQHCipFBb9TasNDKuDHCmOE6TF3uc&noverify=0&group_code=191187164)
3232
- Telegram 交流群:[@bilibili_API_collect_community](https://t.me/bilibili_API_collect_community)
3333

34-
::: tip 提示
34+
::: tip 提示
3535

3636
QQ 交流群为综合技术交流群(兼 Owner 的粉丝群),可交流探讨任何技术,包括但不限于 [BAC 项目](https://github.com/SocialSisterYi/bilibili-API-collect)
3737

3838
Telegram 交流群主要用作 [BAC 项目](https://github.com/SocialSisterYi/bilibili-API-collect)的 Github Bot 接收,也可以进行项目相关的讨论,但不建议在此讨论交流其他内容(公开群)
3939

4040
:::
4141

42-
::: warning ⚠️注意
42+
::: warning 注意
4343

4444
群内讨论同样需要遵守**公开交流**的原则,以及群内会定期清理不活跃成员。
4545

4646
**QQ 交流群**的加群问题答案可以去 [Owner 的主页](https://github.com/SocialSisterYi) Contact 部分找到,如果您填写“我不知道,从 Github 来的”那么管理员将有理由禁止您进群讨论!
4747

4848
:::
4949

50-
::: danger 🈲禁止
50+
::: danger 禁止
5151

5252
项目 Issue 及其相关社群中**禁止**询问讨论 风控解除、爬虫(采集)、破解、漏洞利用、买卖代码和账号 相关内容,抵制基于本项目进行的一切黑产行为!
5353

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接
3737

3838
小小的 Demo:~~av583785685~~ [视频失效原因](https://shakaianee.top/archives/56/) ([Youtube 备链](https://www.youtube.com/watch?v=nfF91Z6fqGk))
3939

40-
::: warning ⚠️声明
40+
::: warning 声明
4141

4242
1. 本项目遵守 CC-BY-NC 4.0 协议,禁止一切商业使用,如需转载请注明作者 ID
4343
2. **请勿滥用,本项目仅用于学习和测试!请勿滥用,本项目仅用于学习和测试!请勿滥用,本项目仅用于学习和测试!**
@@ -393,9 +393,3 @@ OR Aifadian:[https://afdian.com/@ShakaiAneE](https://afdian.com/@ShakaiAneE)
393393
- [grpc/grpc](https://github.com/grpc/grpc): The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
394394
- [glideapps/quicktype](https://github.com/glideapps/quicktype): quicktype generates strongly-typed models and serializers from JSON, JSON Schema, TypeScript, and GraphQL queries, making it a breeze to work with JSON type-safely in many programming languages. 一键生成多种语言的JSON反序列化所需类,以便于快速反序列化,有网页版
395395
- [SessionHu/json-apidoc-gen](https://github.com/SessionHu/json-apidoc-gen): Simple CLI tool for generating BAC document template
396-
397-
<style scoped>
398-
.shields a {
399-
margin: auto .5em;
400-
}
401-
</style>

docs/live/message_stream.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ type===106
21572157

21582158
<details>
21592159
<summary>查看消息示例:</summary>
2160-
2160+
21612161
```json
21622162
{
21632163
"cmd": "ONLINE_RANK_V2",
@@ -2225,7 +2225,7 @@ type===106
22252225
}
22262226
}
22272227
```
2228-
2228+
22292229
</details>
22302230

22312231
#### 未登录通知 (LOG_IN_NOTICE)

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"repository": "https://github.com/SocialSisterYi/bilibili-API-collect.git",
55
"author": "SocialSisterYi <[email protected]>",
66
"license": "CC-BY-NC-4.0",
7-
"dependencies": {
8-
"markdown-it-task-lists": "^2.1.1"
9-
},
107
"scripts": {
118
"dev": "vuepress dev",
12-
"build": "vuepress build"
9+
"build": "NODE_OPTIONS='--max-old-space-size=8192' vuepress build"
1310
},
1411
"devDependencies": {
15-
"vuepress": "2.0.0-beta.67",
16-
"vuepress-plugin-copy-code2": "2.0.0-beta.237",
17-
"vuepress-vite": "2.0.0-beta.67",
18-
"@vuepress/plugin-search": "^2.0.0-beta.67"
12+
"@vuepress/bundler-vite": "^2.0.0-rc.24",
13+
"@vuepress/plugin-search": "^2.0.0-rc.110",
14+
"@vuepress/plugin-shiki": "^2.0.0-rc.110",
15+
"@vuepress/theme-default": "^2.0.0-rc.110",
16+
"markdown-it-task-lists": "^2.1.1",
17+
"sass-embedded": "^1.89.2",
18+
"vuepress": "^2.0.0-rc.24"
1919
}
2020
}

0 commit comments

Comments
 (0)