docsify/docs/README.md

99 lines
1.6 KiB
Markdown
Raw Normal View History

2016-11-26 17:24:32 +08:00
# docsify
2016-11-20 22:41:18 +08:00
2016-11-26 17:24:32 +08:00
> A magical documentation site generator.
2016-11-20 22:41:18 +08:00
## Features
- Easy and lightweight
2016-11-26 17:24:32 +08:00
- Custom themes
- No build
2016-11-20 22:41:18 +08:00
2016-11-26 17:24:32 +08:00
## Quick Start
2016-11-20 22:41:18 +08:00
2016-11-26 17:24:32 +08:00
### Create a project
First create a project, then create a `docs` folder
```shell
mkdir my-project && cd my-project
mkdir docs && cd docs
```
### Create entry file
Create a `404.html` file
2016-11-20 22:41:18 +08:00
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
2016-11-20 22:49:32 +08:00
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
2016-11-20 22:41:18 +08:00
</head>
2016-11-26 17:24:32 +08:00
<body>
<div id="app"></div>
</body>
2016-11-22 22:46:44 +08:00
<script src="//unpkg.com/docsify"></script>
2016-11-20 22:41:18 +08:00
</html>
```
2016-11-26 17:24:32 +08:00
Create `README.md` as the main page
```
# Title
## balabala
```
### Deploy!
Push and open the **GitHub Pages** feature
![image](https://cloud.githubusercontent.com/assets/7565692/20639058/e65e6d22-b3f3-11e6-9b8b-6309c89826f2.png)
## CLI
Easy to setup and preivew a docs.
### Install
```shell
npm i docsify-cli -g
```
### Setup
Setup a boilerplate docs
```shell
docsify init docs
```
### Preview
Preview and serve your docs using
```shell
docsify serve docs
```
Read more [docsify-cli](https://github.com/QingWei-Li/docsify-cli)
2016-11-26 14:09:06 +08:00
2016-11-26 17:24:32 +08:00
## Themes
Currently available `vue.css` and `buble.css`
```html
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
<link rel="stylesheet" href="//unpkg.com/docsify/themes/buble.css">
2016-11-26 14:09:06 +08:00
```
2016-11-26 17:24:32 +08:00
## More
### Multiple pages
If you need other pages, directly create the markdown file, such as `guide.md` is `/guide`.
### Navbar
Code in `404.html`
```html
<nav>
2016-11-26 18:13:39 +08:00
<a href="/docsify/">En</a>
<a href="/docsify/zh-cn">中文</a>
2016-11-26 17:24:32 +08:00
</nav>
```
### GitHub Corner
Modify your `404.html`
```html
<script src="//unpkg.com/docsify" data-repo="your/repo"></script>
```