docs: docs

This commit is contained in:
liuweiqing 2024-02-17 14:05:39 +08:00
commit ac79689a00
11 changed files with 420 additions and 0 deletions

68
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,68 @@
# Sample workflow for building and deploying a VitePress site to GitHub Pages
#
name: Deploy VitePress site to Pages
on:
# Runs on pushes targeting the `main` branch. Change this to `master` if you're
# using the `master` branch as the default branch.
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm # or pnpm / yarn
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci # or pnpm install / yarn install / bun install
# working-directory: ./docs
- name: Build with VitePress
run: |
npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
touch .vitepress/dist/.nojekyll
# working-directory: ./docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: .vitepress/dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

50
.gitignore vendored Normal file
View File

@ -0,0 +1,50 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
pass
.env
.vercel
post.md
# Sentry Config File
.sentryclirc
#vitepress
docs/.vitepress/dist/*
node_modules
docs/.vitepress/cache/*

View File

@ -0,0 +1,36 @@
import { defineConfig } from "vitepress";
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "paperai-docs",
description: "paperai docs",
base: "/paper-ai/",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Home", link: "/" },
{
text: "GitHub",
link: "https://github.com/14790897/paper-ai",
},
],
sidebar: [
{
text: "Examples",
items: [
// { text: "Markdown Examples", link: "/markdown-examples" },
// { text: "Runtime API Examples", link: "/api-examples" },
{ text: "功能介绍 function", link: "/paperai-function" },
{ text: "部署方法 deploy", link: "/paperai-deploy" },
{ text: "环境变量 env", link: "/paperai-env" },
{ text: "界面展示 show", link: "/paperai-interface" },
],
},
],
socialLinks: [
{ icon: "github", link: "https://github.com/vuejs/vitepress" },
],
},
});

49
docs/api-examples.md Normal file
View File

@ -0,0 +1,49 @@
---
outline: deep
---
# Runtime API Examples
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
```md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```
<script setup>
import { useData } from 'vitepress'
const { site, theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
## More
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

30
docs/index.md Normal file
View File

@ -0,0 +1,30 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: "paperai-docs"
text: "paperai docs"
tagline: My great project tagline
actions:
- theme: brand
text: paperai-function
link: /paperai-function
- theme: brand
text: paperai-deploy
link: /paperai-deploy
- theme: brand
text: paperai-env
link: /paperai-env
- theme: alt
text: API Examples
link: /api-examples
features:
- title: Feature 1 使用真实文献
details: 从各种文献网站获取真实文献
- title: Feature 2 AI写作
details: 内置免费AI模型
- title: Feature 3 文献管理
details: 将文献有序地排列
---

85
docs/markdown-examples.md Normal file
View File

@ -0,0 +1,85 @@
# Markdown Extension Examples
This page demonstrates some of the built-in markdown extensions provided by VitePress.
## Syntax Highlighting
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
**Input**
````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````
**Output**
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
## Custom Containers
**Input**
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
**Output**
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
## More
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

36
docs/paperai-deploy.md Normal file
View File

@ -0,0 +1,36 @@
## 镜像运行
1. 拉取镜像
```sh
docker pull 14790897/paperai:latest
```
2. 运行镜像
```sh
docker run -d -p 3000:3000 \
-e NEXT_PUBLIC_AI_URL=自定义AI模型地址\
-e NEXT_PUBLIC_OPENAI_API_KEY=自定义API KEY \
14790897/paperai:latest
```
## vercel 部署
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/14790897/paper-ai&project-name=paper-ai&repository-name=paper-ai&demo-title=paper-ai&demo-description=This%20starter%20configures%20Supabase%20Auth%20to%20use%20cookies%2C%20making%20the%20user's%20session%20available%20throughout%20the%20entire%20Next.js%20app%20-%20Client%20Components%2C%20Server%20Components%2C%20Route%20Handlers%2C%20Server%20Actions%20and%20Middleware.&demo-url=https%3A%2F%2Fdemo-nextjs-with-supabase.vercel.app%2F&external-id=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fwith-supabase&demo-image=https%3A%2F%2Fpaperai.life%2Fopengraph-image.png)
## 克隆在本地运行
```bash
# 克隆版本库
git clone https://github.com/14790897/paper-ai.git
# 进入项目目录
cd paper-ai
# 安装依赖项
npm install
# 运行项目
npm run dev
```

7
docs/paperai-env.md Normal file
View File

@ -0,0 +1,7 @@
## 环境变量说明
1. NEXT_PUBLIC_OPENAI_API_KEY 设置key只要在设置界面右上角齿轮对应的位置留空就会使用预定的变量
2. NEXT_PUBLIC_AI_URL 设置上游url只要在设置界面右上角齿轮对应的位置留空就会使用预定的变量
3. NEXT_PUBLIC_SEMANTIC_API_KEY 设置semantic scholar的key可以增加请求量
4. NEXT_PUBLIC_PUBMED_API_KEY 设置pubmed的key可以增加请求量

29
docs/paperai-function.md Normal file
View File

@ -0,0 +1,29 @@
---
title: 介绍
sidebar: auto
---
## 功能介绍
- **人工智能书写功能** 点击 "AI 写作 "进行正常对话互动。人工智能将根据您的输入提供写作建议或回答问题。
- **寻找文献功能** 点击 "寻找文献",根据输入的关键词在 Semantic Scholar 或 arxiv 或 PubMed通过下拉框选择 中搜索论文。系统将把信息整合到您的论文中。一次搜索两篇,无搜索结果时会显示错误提示。
- **文献整理功能** 每次获得的文献都会被整理到页面下方
- **导出到 word** 页面最下方的导出 word 按钮可以将论文和文献引用直接导出到 word十分方便
- **内置多个免费 AI 模型**:请在右上角设置界面查看
- **云同步及多篇论文编辑功能**:此功能暂定收费二十元人民币永久开通,请点击左上角列表按钮进行购买,购买前需要注册账号
![](https://file.liuweiqing.life/2024/02/558e11d675d6a07dedbcfdc5ab8d072f.png)
## 具体使用方法
- 左边第一个输入框有两种用法
1. 点击 AI 写作时会读取输入框的内容进行正常的对话交流
2. 点击寻找文献会根据输入的主题词去寻找对应论文(如果输入的是英文关键词就会出现英文文献,中文关键词就是中文文献)
- 寻找文献按钮旁边是一个选择框,用于选择从哪个网站获取论文,目前可以选择 arxivsemantic scholar推荐pubmed比较推荐
- 之后是一个选择模型的选择框,用于选择对话的 AI 模型,支持哪些模型由你的 api 决定
- 往下看是一个大的输入框这里用户可以修改内容AI 生成内容
- 最下面是文献管理区域,用于整理搜索到的文献,符合中文引用格式

20
docs/paperai-interface.md Normal file
View File

@ -0,0 +1,20 @@
## 主界面
![](https://file.liuweiqing.life/2024/02/8efc91ee5f0eff0238b96c8f7c564c05.png)
![](https://file.liuweiqing.life/2024/02/56c022ad42fffc76dcf4215f1948cbb6.png)
## 设置界面
![](https://file.liuweiqing.life/2024/02/0955a53c01c412bdfd447b74c64585e3.png)
## 登录/注册界面
![](https://file.liuweiqing.life/2024/02/2f692952aca0263846e933a8ad9ad22a.png)
## 商店购买界面
![](https://file.liuweiqing.life/2024/02/b87d0022933462957ccf52d83c9b77ab.png)
## VIP 功能(云端同步,多篇文章编辑)
![](https://file.liuweiqing.life/2024/02/fd3b4fd44450a2276466b01b57b11c95.png)

10
package.json Normal file
View File

@ -0,0 +1,10 @@
{
"devDependencies": {
"vitepress": "^1.0.0-rc.42"
},
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
}
}