Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONC highlighting & Upgrade VuePress #1091

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions .github/workflows/vuepress-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
name: deploy and pubish
name: deploy and publish

on: [push]

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: github.repository == 'SocialSisterYi/bilibili-API-collect'
# if: github.repository == 'SocialSisterYi/bilibili-API-collect'
steps:
- name: Checkout
uses: actions/checkout@master

- name: vuepress-deploy
uses: jenkey2011/vuepress-deploy@master
env:
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
TARGET_REPO: SocialSisterYi/bilibili-API-collect
TARGET_BRANCH: gh_pages
BUILD_SCRIPT: yarn && yarn build
BUILD_DIR: .vuepress/dist/
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
cache: yarn
- name: Build with yarn
run: yarn && yarn build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '.vuepress/dist/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
38 changes: 25 additions & 13 deletions .vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
import { defaultTheme, defineUserConfig } from "vuepress";
import { defineUserConfig } from "vuepress";
import { viteBundler } from '@vuepress/bundler-vite'
import { defaultTheme } from "@vuepress/theme-default";
import markdownItTaskLists from "markdown-it-task-lists";
import { copyCodePlugin } from "vuepress-plugin-copy-code2";
import { searchPlugin } from "@vuepress/plugin-search";
import { shikiPlugin } from '@vuepress/plugin-shiki'

const base = "/bilibili-API-collect/";

export default defineUserConfig({
base: "/bilibili-API-collect/",
bundler: viteBundler(),
base: base,
lang: "zh-CN",
title: "BAC Document",
description: "社区开源的第三方哔哩哔哩 API 文档",
head: [["link", { rel: "icon", href: "/logo2.jpg" }]],
head: [["link", { rel: "icon", href: base + "logo2.jpg" }]],
locales: {
"/": {
lang: "zh-CN",
Expand All @@ -34,19 +39,26 @@ export default defineUserConfig({
],
},
],
sidebar: "auto",
repo: "https://github.com/SocialSisterYi/bilibili-API-collect",
docsBranch: "master",
editLinkText: "在 GitHub 上编辑此页",
colorMode: "auto"
colorMode: "auto",
themePlugins: {
prismjs: false
}
}),
plugins: [copyCodePlugin({}), searchPlugin({})],
markdown: {
code: {
lineNumbers: true,
},
},
plugins: [
searchPlugin({}),
shikiPlugin({
theme: 'dark-plus',
langs: [
'javascript', 'typescript', 'markdown', 'protobuf', 'json', 'jsonc',
'shell', 'go', 'html', 'http', 'java', 'kotlin', 'python', 'rust', 'c',
'c++', 'cs', 'php', 'swift', 'text'
]
})
],
extendsMarkdown: (md) => {
md.use(markdownItTaskLists);
},
}
});
14 changes: 14 additions & 0 deletions .vuepress/theme/layouts/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
</ParentLayout>
</template>

<style>
/* protect eyes (plain text) */
div[class*="language-"] pre code {
color: unset;
}
/* README.md */
.shields a {
margin: auto .25em;
}
.shields a::after {
display: none !important;
}
</style>

<script setup>
import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue';
</script>
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
- QQ 交流群:[邀请链接](https://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ympvb3LAPT-Ulu3ezhGqbkJ8zXMKImOX&authKey=z1KdkOdKO3wytN43m9K6On9nBtnDL4pAoD6VQHCipFBb9TasNDKuDHCmOE6TF3uc&noverify=0&group_code=191187164)
- Telegram 交流群:[@bilibili_API_collect_community](https://t.me/bilibili_API_collect_community)

::: tip 提示
::: tip 提示

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

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

:::

::: warning ⚠️注意
::: warning 注意

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

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

:::

::: danger 🈲禁止
::: danger 禁止

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

Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ B站 API 采用 C/S 结构,大多数接口为 REST API 和 gRPC,少部分接

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

::: warning ⚠️声明
::: warning 声明

1. 本项目遵守 CC-BY-NC 4.0 协议,禁止一切商业使用,如需转载请注明作者 ID
2. **请勿滥用,本项目仅用于学习和测试!请勿滥用,本项目仅用于学习和测试!请勿滥用,本项目仅用于学习和测试!**
Expand Down Expand Up @@ -383,9 +383,3 @@ OR Aifadian:[https://afdian.net/@ShakaiAneE](https://afdian.net/@ShakaiAneE)
- [bloomrpc/bloomrpc](https://github.com/bloomrpc/bloomrpc): GUI Client for GRPC Services
- [grpc/grpc](https://github.com/grpc/grpc): The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)
- [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反序列化所需类,以便于快速反序列化,有网页版

<style scoped>
.shields a {
margin: auto .5em;
}
</style>
8 changes: 6 additions & 2 deletions docs/live/message_stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,8 @@ while (!s.isclosed()) {
}
```

</details>

#### 送礼 (SEND_GIFT)

**JSON消息:**
Expand Down Expand Up @@ -1856,6 +1858,8 @@ while (!s.isclosed()) {
}
```

</details>

#### 主播信息更新 (ROOM_REAL_TIME_MESSAGE_UPDATE)

**JSON消息:**
Expand Down Expand Up @@ -1930,7 +1934,7 @@ while (!s.isclosed()) {

<details>
<summary>查看消息示例:</summary>

```json
{
"cmd": "ONLINE_RANK_V2",
Expand Down Expand Up @@ -1998,7 +2002,7 @@ while (!s.isclosed()) {
}
}
```

</details>

#### 用户到达直播间高能榜前三名的消息 (ONLINE_RANK_TOP3)
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
},
"scripts": {
"dev": "vuepress dev",
"build": "vuepress build"
"build": "NODE_OPTIONS='--max-old-space-size=8192' vuepress build"
},
"devDependencies": {
"vuepress": "2.0.0-beta.67",
"vuepress-plugin-copy-code2": "2.0.0-beta.237",
"vuepress-vite": "2.0.0-beta.67",
"@vuepress/plugin-search": "^2.0.0-beta.67"
"@vuepress/bundler-vite": "^2.0.0-rc.17",
"@vuepress/plugin-search": "^2.0.0-rc.52",
"@vuepress/plugin-shiki": "^2.0.0-rc.52",
"@vuepress/theme-default": "^2.0.0-rc.52",
"sass-embedded": "^1.79.4",
"vuepress": "^2.0.0-rc.17"
}
}
Loading