Skip to content

Commit

Permalink
init: 文档项目开源初始化
Browse files Browse the repository at this point in the history
  • Loading branch information
ostli committed Dec 19, 2021
0 parents commit f5835b6
Show file tree
Hide file tree
Showing 205 changed files with 9,967 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/node_modules
!.eslintrc.js
!.commitlintrc.js
!.vuepress
25 changes: 25 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
root: true,
env: {
node: false,
jest: true,
},
extends: [],
rules: {
'arrow-parens': ['warn', 'as-needed'],
indent: ['error', 2, { MemberExpression: 'off' }],

'no-undef': ['error'],

'operator-linebreak': ['error', 'before'],

'vue/match-component-file-name': [
'error',
{
extensions: ['js', 'vue'],
shouldMatchCase: false,
},
],
},
globals: {},
};
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
node_modules
/docs/.vuepress/dist/
package-lock.json
yarn.lock
yarn-error.log

# General
.DS_Store
.AppleDouble
.LSOverride
.idea

# Thumbnails
._*

_book
*.pdf
docs/develop/api/index.html
.temp
6 changes: 6 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ports:
- port: 8080
onOpen: open-preview
tasks:
- init: yarn
command: yarn dev
18 changes: 18 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid",
"htmlWhitespaceSensitivity": "strict",
"useTabs": false,
"tabWidth": 2,
"semi": true,
"overrides": [
{
"files": "*.html",
"options": {
"printWidth": 999
}
}
]
}
9 changes: 9 additions & 0 deletions .remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"preset-lint-recommended",
"preset-lint-consistent",

["lint-list-item-indent", "space"],
["lint-heading-style", false]
]
}
8 changes: 8 additions & 0 deletions .textlint.terms.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
"Stylus",
"VuePress",
[
"front[- ]matter",
"frontmatter"
]
]
23 changes: 23 additions & 0 deletions .textlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
rules: {
'@textlint-rule/no-unmatched-pair': true,
apostrophe: true,
'common-misspellings': true,
diacritics: true,
'en-capitalization': {
allowHeading: false
},
'stop-words': {
severity: 'warning'
},
terminology: {
terms: `${__dirname}/.textlint.terms.json`
},
'write-good': {
severity: 'warning'
}
},
filters: {
comments: true
}
}
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx


COPY nginx.conf /etc/nginx/

COPY ./docs/.vuepress/dist /usr/share/nginx/html

31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 机器人文档

本仓库是QQ机器人文档项目,基于[vuepress](https://vuepress.vuejs.org/zh/)构建。对应文档网站是 <https://bot.q.qq.com/wiki>

## 本地开发

通过以下任何一种方式进行本地开发

### 1、Gitpod 在线开发

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/tencent-connect/bot-docs)

### 2、本地克隆代码开发

```sh
$ git clone [email protected]:tencent-connect/bot-docs.git
$ cd bot-docs
$ npm i
$ npm run dev
```

## 参与共建 [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

- 目前文档还在快速补充和优化中,欢迎各位开发者 PR👏

## 文档结构参考

todo
## 贡献者

todo
38 changes: 38 additions & 0 deletions docs/.vuepress/components/NpmBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<a class="npm-badge"
:href="badgeLink"
:title="packageName"
target="_blank"
rel="noopener noreferrer">
<img :src="badgeImg"
class="disable-zooming"
:alt="packageName" />
</a>
</template>

<script>
export default {
props: {
packageName: {
type: String,
required: true,
},
},
computed: {
badgeLink() {
return `https://www.npmjs.com/package/${this.packageName}`;
},
badgeImg() {
return `https://badgen.net/npm/v/${this.packageName}`;
},
},
};
</script>

<style scoped>
.npm-badge {
display: block;
margin-right: 0.5rem;
margin-top: 1.5rem;
}
</style>
105 changes: 105 additions & 0 deletions docs/.vuepress/components/TuXiaoChao.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<template>
<div>
<div class="app-feed-back-and-help" @click="gotoTXC">
<div class="logo-wrap"><div class="logo"></div></div>
</div>
</div>
</template>

<script>
export default {
methods: {
gotoTXC() {
const form = document.createElement('form');
form.id = 'form';
form.name = 'form';
document.body.appendChild(form);
const data = {
nickname: this.getNickname(),
avatar: 'https://abc-pcweb-1251316161.file.myqcloud.com/others/ost/docs/qq.png',
openid: this.getOpenID(),
customInfo: location.href,
};
for (const key in data) {
const input = document.createElement('input');
input.type = 'text';
input.name = key;
input.value = data[key];
form.appendChild(input);
}
form.method = 'POST';
form.target = '_blank';
form.action = 'https://support.qq.com/product/366887';
form.submit();
document.body.removeChild(form);
},
getOpenID() {
let openid = localStorage.getItem('bot_wiki_openid');
if (!openid) {
openid = `bot_openid_${this.randomString(10)}`;
localStorage.setItem('bot_wiki_openid', openid);
}
return openid;
},
getNickname() {
let nickname = localStorage.getItem('bot_wiki_nickname');
if (!nickname) {
nickname = `wikiUser_${this.randomString(6)}`;
localStorage.setItem('bot_wiki_nickname', nickname);
}
return nickname;
},
randomString(len) {
const str = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
let pwd = '';
for (let i = 0; i < len; i++) {
pwd += str.charAt(Math.floor(Math.random() * str.length));
}
return pwd;
},
},
};
</script>
<style>
.app-feed-back-and-help {
cursor: pointer;
width: 50px;
height: 50px;
position: fixed;
z-index: 19;
bottom: 75px;
right: 23px;
padding: 10px;
border-radius: 3px;
font-size: 13px;
margin-top: 80px;
display: flex;
flex-direction: column;
align-items: center;
}
.app-feed-back-and-help .logo-wrap {
cursor: pointer;
opacity: 0.9;
padding: 15px 10px 10px;
border-radius: 50%;
background: linear-gradient(-180deg, #dadfea, #ebedf5);
}
.app-feed-back-and-help .logo-wrap:hover {
background: #418dff;
}
.app-feed-back-and-help .logo-wrap:hover .logo {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAABGdBTUEAALGPC/xhBQAAAe1JREFUSA29ls8uA1EUxjsqYSOIsCGNjX8bkbDgITyAjfAA3oOFlQXxEHZNI9hJRCJWgoigwkr8j0TQjt9hppk77ZmZzmTmJF/vPd85Pefr3Om9N5dzzLbtBXAEqiBNu6f4Juhxe+dw1tLsqNS+he/L8zGHkpWamuwmnbTqtxBwwGQ6u75GpycR8AOVN+jGzjf0KRgHVuOUOvYSRta6uy7iEC2MUZpL+pJlWROMq+JEsGNyRsEUsLV8ERDVik6iO4Z9bxvBFXBF4rmW3IyAGaeIO2o1Xf4vjyWWJRhySf8o74D6eHzJz/h7YBa0+WKau0OgAEa0hGYEaDUS8c0sQaJG2pdbtUAE/pGcdfDmyx3DX/RxuivvQExTd0/q3UStmWQJ1L8WP/dM/8lmJIkA+X9rdq0F/HwSAUFNgmKGhrgC5Fy4MyqZTtDTMTLjCiizxVaNSqaT+hMIaxAWr8mVJ/BS86JPAhvwdGTbfo1QriwCShES/SlffsLrswfIWSH3jDDbkrOglyw5uwfCsj1xeQnlJvXp4bzTYZxBL9FgfgL3fxNDRAEUQQWkbQ802AAdIsq4WkG2w+2DSQk69s44D3ZdIuH4wTtiqzUQcQhcu2Aih0t2RkNXQIl5V3adnU6OgGXGuJtUMs00lltsZvYLUPxHqiXJxFUAAAAASUVORK5CYII=)
no-repeat 0;
}
.app-feed-back-and-help .logo-wrap .logo {
width: 32px;
height: 28px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAcCAYAAAAAwr0iAAAABGdBTUEAALGPC/xhBQAAAqxJREFUSA21Vs9r1EAUfi/Z7bog1FU8KdWLv26ia1W0rApCD0qhdhdE8CdtL9WbBwX/gB48eShdqeJ1rb21KipbpSC9FARBoVIpiheVqkUQu+b5JWtKEjPJbNqdQ2bmvW++92XeZF6Y/rVypXoewwFi3iMi7NpXu2fiT8Q0njGz18517//qBCpXnt8SsgZWO1g0H3/IptJ58/bo5Gm88WA0uCne1pplbTLEoitNodcgxfZ3GkSyTwMLCC/h8YqZRQ+PFcTv8FxQ4YVkvQE2UwXw2Zkv95eO7gbhTZ9dOeGZdVTYmTbNfJRo7IBeMwxr3EYy1fu4Vcz0uFTiPxdPdcyR0FsVXluAZfFBm0So3qsIPXYHf29segM+6m0eu2/Iw5WqZk55AYfmmbCchIqMj0UxwRl4gjy3wb1DAaGUyvG/XXJQ2oPg2g3Bj8eBtVMQR5TU38AOBEIw4Ro1hljkh9djMe0ikQteW9Q4sQDkd6SvWLgRRl6+Xz0mQlvCfEFb4hTgQCo/LdSyN8FAqnliASLGnIoU9vcRPp8ruQAylEFAqvT5omOSUAAv9RUPfQySuXMxInfHhTl9IgHI/zzud8vH5Jng5mv2DkQHWJthfQF4k28e8VpDicnxmRMddgn+HkeGgjVvp+BhHDDoxx3wO2jzzicmZjMomzWvLXzMY3yn8mJjja0Z/JZtDgeFWZ2fk5cI8ivMi3qxHXVza6hv2civs625AzhPRMOVqTYIHsLWdmJhooO5zBs74C/4qXpgtqSvXuo6vOgIcNfcrVbXLH2mKQjZ69pwRhZRgs/mLHrq2lbSF4tHfoITIerNJ8A2lSuT0yij7Y6bedYwuau3u6B9tdZp9Z8R282PWlLS3szgtszQaojPY7C3p3A96rLRf8cGkSOj1XyDS1YE/wsT+LIWtt/NgQAAAABJRU5ErkJggg==)
no-repeat 0;
}
</style>
24 changes: 24 additions & 0 deletions docs/.vuepress/components/Warnning.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div class="custom-block danger"
><p class="custom-block-title">注意</p>
<ul
><li
>公域机器人暂不支持申请,仅私域机器人可用,私域机器人开发者请发邮件<a href="mailto:[email protected]">[email protected]</a>申请开通。</li
></ul
></div
>
</template>
<script>
export default {
data() {
return {
warnning: ``,
};
},
};
</script>
<style>
.version {
margin-top: 20px;
}
</style>
Loading

0 comments on commit f5835b6

Please sign in to comment.