2 Star 23 Fork 5

aics / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

前端文档

基于vitepress 搭建在线文档模板,支持 markdown 标题搜索,vue3 组件与 js 代码运行

可快速搭建 vue 3.x 项目技术文档。

如果感觉对您有用,欢迎 star

快速开始

  • 克隆项目

git clone git@github.com:appbest/docs.git
  • 安装
# yarn 安装
yarn

# 调试
yarn docs:dev

# 打包
yarn docs:build

vite 解决引用组件热更问题

清除缓存目录,

/node_modules/.vite_opt_cache

重要提示

  • 需修改源码二级目录路径问题,参考文档底部
  • 调试时可删除
  • 编译缓存目录 /node_modules/.vite
  • 更新搜索数据源keywords.json,删除将生成最新数据源

更新

0.3.3

2022/8/19

  • qve:0.4.1

0.3.2

2022/4/1

  • qve:0.3.9

0.2.9

2022/1/15

  • qve:0.3.5
  • quick-plugin-md:0.2.3
  • 支持 Less 解析
  • 支持脑图插件

文档组件

  • packages 文件夹

CodeRun 代码在线调试

<CodeRun dll="json" styled="height:20rem" ubb editable>

// js 在线测试执行代码
return 'test';

</CodeRun>

项目依赖

vitepress 发布文档

图标目录

发布到服务器时需要将源图标文件夹 /docs/fonts 内容复制到打包的 /dist/ 目录

vitepress 动态组件报错

如需动态编译执行 vue 组件代码,需修改源码

  • vitepress 版本 0.21.4 需修改以下路径代码 node_modeules>vitepress>dist>node>serve-3fdbda2c.js
// 第12309行注释,替换为编译
//const vueRuntimePath = "vue/dist/vue.runtime.esm-bundler.js";
const vueRuntimePath = 'vue/dist/vue.esm-bundler.js';
  • vitepress 版本 0.13.0 alias配置失效,。 需修改以下路径代码 node_modeules>vitepress>dist>node>serve-3fdbda2c.js
// 第12333行注释,替换为编译
    {
      find: /^vue$/,
    // replacement: require.resolve("vue/dist/vue.runtime.esm-bundler.js")
       replacement: require.resolve("vue/dist/vue.esm-bundler.js")
    }

域名二级目录路径问题

  • 目录名与文件名,请使用小写

  • vitepress 0.8.1 及以下需要,当前项目无需更新。

    需要发布为二级目录时,调试正常正式发布时会导致路径错误, 需要修改以下文件。

    node_modeules\vitepress\dist\client\app\utils.js

    第 20 行(把整个 base 路径删除了导致 Bug 修改为 1 正常取值)

    //pagePath = pagePath.slice(base.length).replace(/\//g, '_') + '.md';
    
    // 网站路径替换为文档目录
    pagePath = 'docs/' + pagePath.slice(base.length);
    pagePath = pagePath.replace(/\//g, '_') + '.md';
    // console.log(base,pagePath);

git 入门


# 初始化
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:appbest/docs.git
git push -u origin main

github pages 部署

#!/usr/bin/env sh

# 忽略错误
set -e

# 构建
# npm run docs:build

# 进入待发布的目录
cd docs/.vitepress/dist

# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy'

# 如果部署到 https://<USERNAME>.github.io
# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master

# 如果是部署到 pages https://<USERNAME>.github.io/<REPO>
git push -f git@github.com:appbest/docs.git master:gh-pages

# 同步部署到 qve.gitee.io/docs/
git push -f git@gitee.com:qve/docs.git master:gh-pages
MIT License Copyright (c) 2020 AiBo 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.

简介

极简快速的文档模板,支持全站搜索markdown 与实时运行vue 3.x组件,js代码在线调试, 基于vite与vitepress 构建。支持less 解析,支持脑图显示 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/qve/docs.git
git@gitee.com:qve/docs.git
qve
docs
docs
main

搜索帮助