Skip to content

Commit

Permalink
new doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Sep 18, 2024
1 parent a542572 commit 5a3cb0e
Show file tree
Hide file tree
Showing 53 changed files with 2,827 additions and 3,950 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
name: dist
path: dist/
name: out
path: out/

deploy:
needs: build
Expand All @@ -40,4 +40,4 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: dist
artifact_name: out
24 changes: 3 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
.next
node_modules
out
4 changes: 0 additions & 4 deletions .vscode/extensions.json

This file was deleted.

11 changes: 0 additions & 11 deletions .vscode/launch.json

This file was deleted.

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Shu Ding

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
63 changes: 0 additions & 63 deletions astro.config.mjs

This file was deleted.

13 changes: 13 additions & 0 deletions components/logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useTheme } from "nextra-theme-docs";

export default function Logo(props: any): React.ReactNode {
const { resolvedTheme } = useTheme();

return (
<img
{...props}
src={resolvedTheme === "dark" ? "/logo-white.png" : "/logo-black.png"}
alt="Logo"
/>
);
}
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
11 changes: 11 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
})

module.exports = withNextra({
output: 'export',
images: {
unoptimized: true,
}
})
30 changes: 18 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
{
"name": "mihomo-party-docs",
"type": "module",
"name": "nextra-docs-template",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro"
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@astrojs/starlight": "^0.25.5",
"astro": "^4.10.2",
"sharp": "^0.32.5",
"@astrojs/check": "^0.9.2",
"typescript": "^5.5.4"
"next": "^14.2.11",
"nextra": "^2.13.4",
"nextra-theme-docs": "^2.13.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0"
},
"devDependencies": {
"@types/node": "22.5.5",
"@types/react": "^18.3.6",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.12",
"typescript": "^5.6.2"
}
}
5 changes: 5 additions & 0 deletions pages/_app.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import "./globals.css";

export default function App({ Component, pageProps }) {
return <Component {...pageProps} />;
}
20 changes: 20 additions & 0 deletions pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"index": {
"title": "主页",
"type": "page",
"theme": {
"layout": "raw"
}
},
"download": {
"title": "下载",
"type": "page",
"theme": {
"layout": "raw"
}
},
"docs": {
"title": "使用指南",
"type": "page"
}
}
5 changes: 5 additions & 0 deletions pages/docs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"install": "安装指南",
"guide": "使用指南",
"issues": "常见问题"
}
5 changes: 5 additions & 0 deletions pages/docs/guide/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"override": "覆写",
"icon": "代理组图标",
"urlscheme": "URL Scheme"
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: 策略组图标
title: 代理组图标
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import { Tabs, Callout } from "nextra/components";

配置策略组中的 [icon](https://wiki.metacubex.one/config/proxy-groups/#icon) 字段,支持 `http`/`base64`/`svg`
配置策略组中的 [icon](https://wiki.metacubex.one/config/proxy-groups/#icon) 字段,支持 `http` / `base64` / `svg`

:::tip[关于 GLOBAL 组]
`GLOBAL`策略组也可以在配置文件中自定义
<Callout type="info">
`GLOBAL` 策略组也可以在配置文件中自定义

但 web 面板以及部分客户端使用`GLOBAL`策略组内的 策略组顺序 进行排序
但 web 面板以及部分客户端使用 `GLOBAL` 策略组内的 策略组顺序 进行排序

建议在自定义`GLOBAL`策略组时,书写完整当前配置所有的策略组 (除了 GLOBAL 本身)
:::
建议在自定义 `GLOBAL` 策略组时,书写完整当前配置所有的策略组 (除了 GLOBAL 本身)

<Tabs>
<TabItem label="http">
</Callout>

<Tabs items={['http', 'base64', 'svg']}>
<Tabs.Tab>

```yaml
proxy-groups:
Expand All @@ -24,8 +25,8 @@ proxy-groups:
...
```

</TabItem>
<TabItem label="base64">
</Tabs.Tab>
<Tabs.Tab>

```yaml
proxy-groups:
Expand All @@ -34,9 +35,8 @@ proxy-groups:
...
```

</TabItem>
<TabItem label="svg">

</Tabs.Tab>
<Tabs.Tab>
使用 svg 文件的内容时需要对引号进行转义

```yaml
Expand All @@ -50,5 +50,5 @@ proxy-groups:
...
```

</TabItem>
</Tabs.Tab>
</Tabs>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 功能简介
title: 覆写
---

覆写功能用于对订阅配置进行自定义修改,使用覆写功能修改订阅配置可以使得修改在更新订阅后依然生效。
Expand All @@ -12,7 +12,7 @@ title: 功能简介

## 使用方法

> Mihomo Party 的覆写功能并非全局生效,需要在需要启用覆写的订阅中指定覆写文件
> Mihomo Party 的覆写功能可以全局启用,也可以指定在某个订阅上启用
1. 打开 Mihomo Party,左侧导航栏打开“覆写”页面,使用链接导入覆写文件或打开本地文件以导入。
2. 点击想要编辑的覆写文件,编辑完成后点击保存。
Expand All @@ -23,8 +23,12 @@ title: 功能简介

### YAML

yaml 格式的覆写文件写法与订阅配置文件相同,只需将需要修改的条目写入即可,具体写法请参考[YAML](/guides/function/override/yaml)
yaml 格式的覆写文件写法与订阅配置文件相同,只需将需要修改的条目写入即可,具体写法请参考 [YAML](/docs/guide/override/yaml)

### JavaScript

使用 `JavaScript` 可以对配置进行更加灵活的修改,具体写法请参考[JavaScript](/guides/function/override/js)
使用 `JavaScript` 可以对配置进行更加灵活的修改,具体写法请参考 [JavaScript](/docs/guide/override/javascript)

## 实用覆写

更多实用的现成覆写文件请参考 [Mihomo Party 覆写仓库](https://github.com/mihomo-party-org/override-hub)
4 changes: 4 additions & 0 deletions pages/docs/guide/override/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"yaml": "YAML",
"javascript": "JavaScript"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ function main(config) {
config.rules.unshift("DOMAIN,google.com,DIRECT");
return config;
}
```
```
Loading

0 comments on commit 5a3cb0e

Please sign in to comment.