Git Product home page Git Product logo

vuepresstest's Introduction

1. vuepress的使用(https://www.vuepress.cn/)

2. 同一个项目下管理组件开发和文档维护

在同一个项目中既要管理组件源码开发,又要维护组件文档,一个比较好的方式是master作为组件源码开发,gh-pages作为维护组件文档分之。

  1. 在已有项目内部增加docs文件夹
  • README.md是文档首页内容,必须设置

  • quick_start 首页快速上手,方便跳转到文档链接

  • .vuepress是vuepress必须的配置文件,包含config.js配置文件/样式/静态资源等。

  • component 存放组件库每个组件的md文档

  1. package.json中增加
  "scripts": {
  "dev": "vuepress dev docs",
  "build": "vuepress build docs"
},
  1. 当你在主分支完成组件开发,增加该组件的文档之后想要发布到静态服务器上,可以首先npm run build:doc,得到编译后的静态文件

  2. 然后在项目根目录运行 sh ./deploy.sh 即可发布静态文件到gh-pages.

3.需要特别注意的一点是config.js下base的配置影响发布之后静态文件的访问路径。

比如我的仓库是https://github.com/kellywang1314/vuepresstest/

  1. 我build之后的静态文件都存放在public下,发布到gh-pages的目录形式为public, 静态文件访问路由为https://kellywang1314.github.io/vuepresstest/public/ 那我的base应该是'/vuepresstest/public/'.

  2. 我build之后的静态文件都存放在根目录下,发布到gh-pages的目录形式为/, 静态文件访问路由为https://kellywang1314.github.io/vuepresstest/ 那我的base应该是'/vuepresstest/'.

vuepresstest's People

Contributors

kellywang1314 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.