Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
Description:

Log:
  • Loading branch information
mikigo committed Jun 11, 2024
1 parent 6f7d7f6 commit b84c574
Show file tree
Hide file tree
Showing 14 changed files with 419 additions and 17 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- run: cd docs/;bash docs_env.sh

- name: Build
run: export VITE_BASE="/youqu/";pnpm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/.vitepress/dist
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

--------------

**[YouQu3]()** 旨在成为下一代 Linux 自动化测试框架,全新的插件化及模块化功能,带来全新的使用效果。
文档:

--------------

[YouQu3架构设计.md](docs/YouQu3架构设计.md)
**[YouQu3]()** 旨在成为下一代 Linux 自动化测试框架,全新的插件化及模块化功能,带来全新的使用效果。

## [特性]()

Expand Down Expand Up @@ -56,14 +58,14 @@ pip install youqu3[http]

## [YouQu3 插件生态]()

| **序号** | YouQu3 插件名称 | 说明 |
| 序号(是否可用) | YouQu3 插件名称 | 说明 |
| :----------------------------------------------------------: | ------------------------------------ | ------------------------------------ |
| 1 | [youqu-dogtail](https://github.com/funny-dream/youqu-dogtail) | 属性定位插件 |
| 2 | [youqu-imagecenter-rpc](https://github.com/funny-dream/youqu-imagecenter-rpc) | 基于 RPC 服务的图像识别插件 |
| 3 | [youqu-mousekey](https://github.com/funny-dream/youqu-mousekey) | 键鼠操作插件 |
| 4 | [pytest-youqu-playwright](https://github.com/funny-dream/pytest-youqu-playwright) | 基于 Playwright 的 Web UI 自动化插件 |
| 5 | [funnylog](https://linuxdeepin.github.io/funnylog/) | 全自动日志插件 |
| 6 | [pdocr-rpc](https://linuxdeepin.github.io/pdocr-rpc/) | 基于 RPC 服务的 OCR 识别插件 |
| 7 | [pytest-mark-manage](https://github.com/funny-dream/pytest-mark-manage) | 用例标签化管理插件 |
| 8 | [wdotool](https://github.com/funny-dream/wdotool) | Wayland下完美的键鼠工具 |
| 1 ☑ | [youqu-dogtail](https://github.com/funny-dream/youqu-dogtail) | 属性定位插件 |
| 2 ☐ | [youqu-imagecenter-rpc](https://github.com/funny-dream/youqu-imagecenter-rpc) | 基于 RPC 服务的图像识别插件 |
| 3 ☑ | [youqu-mousekey](https://github.com/funny-dream/youqu-mousekey) | 键鼠操作插件 |
| 4 ☐ | [pytest-youqu-playwright](https://github.com/funny-dream/pytest-youqu-playwright) | 基于 Playwright 的 Web UI 自动化插件 |
| 5 ☑ | [funnylog](https://linuxdeepin.github.io/funnylog/) | 全自动日志插件 |
| 6 ☑ | [pdocr-rpc](https://linuxdeepin.github.io/pdocr-rpc/) | 基于 RPC 服务的 OCR 识别插件 |
| 7 ☑ | [pytest-mark-manage](https://github.com/funny-dream/pytest-mark-manage) | 用例标签化管理插件 |
| 8 ☐ | [wdotool](https://github.com/funny-dream/wdotool) | Wayland 下完美的键鼠工具 |

90 changes: 90 additions & 0 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import {defineConfig} from 'vitepress'
import {withMermaid} from "vitepress-plugin-mermaid";
import timeline from "vitepress-markdown-timeline";
import {version} from "../../package.json"

// https://vitepress.dev/reference/site-config
export default withMermaid(
defineConfig({
base: process.env.VITE_BASE,
lang: 'zh-CN',
title: "YouQu3 | 下一代Linux自动化测试框架",
description: "使用简单且功能强大的自动化测试框架",
head: [
['meta', {name: 'referrer', content: 'no-referrer-when-downgrade'}],
['link', {rel: 'icon', href: `${process.env.VITE_BASE || '/'}favicon.ico`}],
],
vite: {
publicDir: "assets",
},
markdown: {
config: (md) => {
md.use(timeline)
}
},

themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: "YouQu3",
nav: [
{text: '首页', link: '/index'},
{text: '设计', link: '/设计/YouQu3架构设计规划'},
{
text: '插件', items: [
{text: "日志系统 | funnylog", link: "https://linuxdeepin.github.io/funnylog/"},
{text: "文字识别 | pdocr-rpc", link: "https://linuxdeepin.github.io/pdocr-rpc/"},
]
},
],

sidebar: {
"/设计/": [
{
text: "框架设计",
collapsed: false,
items: [
{text: "YouQu3架构设计规划", link: "/设计/YouQu3架构设计规划"},
{text: "APP工程设计方案", link: "/设计/APP工程设计方案"},
]
},
],
},
search: {
provider: 'local'
},
ignoreDeadLinks: true,
// =========================================================
logo: {src: '/logo.png', width: 26, height: 30},
socialLinks: [
{icon: 'github', link: 'https://github.com/funny-dream/youqu3'}
],
footer: {
copyright: `版权所有 © 2024-${new Date().getFullYear()} 统信软件`
},
//大纲显示2-3级标题
outline: [2, 4],
//大纲顶部标题
outlineTitle: '当前页大纲',

docFooter: {
prev: '上一页',
next: '下一页'
},

lastUpdated: {
text: '最后更新于',
formatOptions: {
dateStyle: 'short',
timeStyle: 'medium'
}
},

langMenuLabel: '多语言',
returnToTopLabel: '回到顶部',
sidebarMenuLabel: '菜单',
darkModeSwitchLabel: '主题',
lightModeSwitchTitle: '切换到浅色模式',
darkModeSwitchTitle: '切换到深色模式'
},
})
);
41 changes: 41 additions & 0 deletions docs/.vitepress/theme/components/PageInfo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<script setup>
import DefaultTheme from 'vitepress/theme'
import { useData } from 'vitepress'
import { ref } from 'vue'
const { Layout } = DefaultTheme
const defaultAuthor = 'mikigo'
const { frontmatter } = useData() //这里的frontmatter就是各个md文件中自己写在最上面的东西
</script>

<template>
<div class="page_info">
<span class="page_info_item" v-if="frontmatter.Author">
🎨
<span>作者:{{ frontmatter.Author }}</span>
</span>
<span class="page_info_item" v-if="frontmatter.date">
🕐
<span>发表于:{{ frontmatter.date ? frontmatter.date.substring(0, 10) : '' }}</span>
</span>
<span class="page_info_item">
📔
<span id="busuanzi_container_page_pv">
阅读量:<span id="busuanzi_value_page_pv"></span>
</span>
</span>

</div>
</template>

<style>
.page_info {
margin-bottom: 48px;
}
.page_info .page_info_item {
font-size: 16px;
color: #7f7f7f;
margin-right: 10px;
}
</style>
28 changes: 28 additions & 0 deletions docs/.vitepress/theme/components/Statistics.Vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<div class="statistics">
<div class="busuanzi">
<span id="busuanzi_container_site_pv" style="display:none;margin-right: 20px;">
本站总访问量
<span id="busuanzi_value_site_pv"></span>次
<!-- <span class="post-meta-divider">|</span> -->
</span>
❤️
<span id="busuanzi_container_site_uv" style="display:none;margin-left: 20px;">
本站访客数
<span id="busuanzi_value_site_uv"></span>人
</span>
</div>
</div>
</template>
<style>
.statistics {
text-align: center;
bottom: 100px;
position: absolute;
margin: 0 auto;
left: 0;
right: 0;
color: grey;
font-size: 15px;
}
</style>
72 changes: 72 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import DefaultTheme from 'vitepress/theme';
import { h, onMounted, watch, nextTick } from "vue";
import giscusTalk from 'vitepress-plugin-comment-with-giscus';
import { useData, useRoute, inBrowser } from 'vitepress';
import mediumZoom from 'medium-zoom';
import vitepressBackToTop from 'vitepress-plugin-back-to-top';
import 'vitepress-plugin-back-to-top/dist/style.css';
import "vitepress-markdown-timeline/dist/theme/index.css";
import busuanzi from 'busuanzi.pure.js';

import './style/index.css';
import PageInfo from './components/PageInfo.vue';

export default {
extends: DefaultTheme,

Layout() {
return h(DefaultTheme.Layout, null, {
"doc-before": () => h(PageInfo) // 文章阅读统计
});
},

enhanceApp({ app , router }) {
if (inBrowser) {
router.onAfterRouteChanged = () => {
busuanzi.fetch()
};
}

vitepressBackToTop({
// default
threshold:300
})

},

setup() {
// Get frontmatter and route
const {frontmatter} = useData();
const route = useRoute();
const initZoom = () => {
mediumZoom('.main img', { background: 'var(--vp-c-bg)' })
};
onMounted(() => {
initZoom()
});
watch(
() => route.path,
() => nextTick(() => initZoom())
);

// giscus配置
giscusTalk(
{
repo: 'linuxdeepin/youqu', //仓库
repoId: 'R_kgDOKDOpHg', //仓库ID
category: 'Announcements', // 讨论分类
categoryId: 'DIC_kwDOKDOpHs4CcRPx', //讨论分类ID
mapping: 'pathname',
inputPosition: 'top',
lang: 'zh-CN',
},
{
frontmatter, route
},
//默认值为true,表示已启用,此参数可以忽略;
//如果为false,则表示未启用
//您可以使用“comment:true”序言在页面上单独启用它
true
)
},
}
1 change: 1 addition & 0 deletions docs/.vitepress/theme/style/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import './var.css';
7 changes: 7 additions & 0 deletions docs/.vitepress/theme/style/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.medium-zoom-image {
z-index: 21;
}

.medium-zoom-overlay {
z-index: 20;
}
23 changes: 23 additions & 0 deletions docs/.vitepress/theme/style/var.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
h1 {
background: -webkit-linear-gradient(120deg, #28C76F 30%, #28C76F);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;

}

h2 {
background: -webkit-linear-gradient(120deg, #28C76F 30%, #28C76F);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;

}

.medium-zoom-overlay {
z-index: 20;
}

.medium-zoom-image {
z-index: 9999 !important;/* 给的值是21,但是实测盖不住,直接999 */
}
34 changes: 34 additions & 0 deletions docs/docs_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set -e
ROOT_DIR=$(dirname "$(pwd)")

cd ${ROOT_DIR}
docs_path="$( cd "$( dirname "$0")" && pwd)"
if [[ "${docs_path}" != "${PWD}" ]]; then
cd "${docs_path}" || exit 1
fi

node_version=v18.16.1
opt_node_dir="node${node_version}"

if ! command -v node &> /dev/null; then
wget https://cdn.npmmirror.com/binaries/node/${node_version}/node-${node_version}-linux-x64.tar.xz
tar -xvJf node-${node_version}-linux-x64.tar.xz
sudo rm -rf /opt/${opt_node_dir}
sudo mv node-${node_version}-linux-x64 /opt/${opt_node_dir}
sudo rm -rf /usr/local/bin/npm; sudo ln -s /opt/${opt_node_dir}/bin/npm /usr/local/bin/npm
sudo rm -rf /usr/local/bin/node; sudo ln -s /opt/${opt_node_dir}/bin/node /usr/local/bin/node
elif ! command -v pnpm &> /dev/null; then
npm config set registry https://registry.npmmirror.com
npm install -g pnpm
sudo rm -rf /usr/local/bin/pnpm; sudo ln -s /opt/${opt_node_dir}/bin/pnpm /usr/local/bin/pnpm
sudo rm -rf /usr/local/bin/pnpx; sudo ln -s /opt/${opt_node_dir}/bin/pnpx /usr/local/bin/pnpx
fi

pnpm add -D vitepress
pnpm i vitepress-plugin-comment-with-giscus
pnpm i vitepress-plugin-back-to-top
pnpm add -D busuanzi.pure.js
pnpm add -D markdown-it-mathjax3
pnpm i @mermaid-js/[email protected] [email protected] [email protected]
pnpm i medium-zoom
pnpm add -D vitepress-markdown-timeline
Loading

0 comments on commit b84c574

Please sign in to comment.