Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit 41c7f09

Browse files
committed
chore(package.json): add docsify
1 parent d7ff80c commit 41c7f09

File tree

6 files changed

+121
-15
lines changed

6 files changed

+121
-15
lines changed

docs/.nojekyll

Whitespace-only changes.

docs/DEVELOPERS.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/_sidebar.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Getting started
2+
3+
- [Quick start](quickstart.md)

docs/index.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>docs</title>
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
7+
<meta name="description" content="Description">
8+
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
9+
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
10+
</head>
11+
<body>
12+
<div id="app"></div>
13+
<script>
14+
window.$docsify = {
15+
name: 'docs',
16+
repo: '',
17+
loadSidebar: true
18+
}
19+
</script>
20+
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
21+
</body>
22+
</html>

docs/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
"license": "MIT",
77
"private": true,
88
"scripts": {
9+
"start": "docsify serve ./",
910
"textlint": "textlint --config .textlintrc ./*.md",
1011
"textlint:fix": "yarn textlint --fix --format diff"
1112
},
1213
"dependencies": {
14+
"docsify-cli": "^4.3.0",
1315
"textlint": "^11.2.5",
1416
"textlint-filter-rule-whitelist": "^2.0.0",
1517
"textlint-rule-no-todo": "^2.0.1",

docs/quickstart.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Quick start
2+
3+
It is recommended to install `docsify-cli` globally, which helps initializing and previewing the website locally.
4+
5+
```bash
6+
npm i docsify-cli -g
7+
```
8+
9+
## Initialize
10+
11+
If you want to write the documentation in the `./docs` subdirectory, you can use the `init` command.
12+
13+
```bash
14+
docsify init ./docs
15+
```
16+
17+
## Writing content
18+
19+
After the `init` is complete, you can see the file list in the `./docs` subdirectory.
20+
21+
* `index.html` as the entry file
22+
* `README.md` as the home page
23+
* `.nojekyll` prevents GitHub Pages from ignoring files that begin with an underscore
24+
25+
You can easily update the documentation in `./docs/README.md`, of course you can add [more pages](more-pages.md).
26+
27+
## Preview your site
28+
29+
Run the local server with `docsify serve`. You can preview your site in your browser on `http://localhost:3000`.
30+
31+
```bash
32+
docsify serve docs
33+
```
34+
35+
?> For more use cases of `docsify-cli`, head over to the [docsify-cli documentation](https://github.com/docsifyjs/docsify-cli).
36+
37+
## Manual initialization
38+
39+
If you don't like `npm` or have trouble installing the tool, you can manually create `index.html`:
40+
41+
```html
42+
<!-- index.html -->
43+
44+
<!DOCTYPE html>
45+
<html>
46+
<head>
47+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
48+
<meta name="viewport" content="width=device-width,initial-scale=1">
49+
<meta charset="UTF-8">
50+
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
51+
</head>
52+
<body>
53+
<div id="app"></div>
54+
<script>
55+
window.$docsify = {
56+
//...
57+
}
58+
</script>
59+
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
60+
</body>
61+
</html>
62+
```
63+
64+
If you installed python on your system, you can easily use it to run a static server to preview your site.
65+
66+
```bash
67+
cd docs && python -m SimpleHTTPServer 3000
68+
```
69+
70+
## Loading dialog
71+
72+
If you want, you can show a loading dialog before docsify starts to render your documentation:
73+
74+
```html
75+
<!-- index.html -->
76+
77+
<div id="app">Please wait...</div>
78+
```
79+
80+
You should set the `data-app` attribute if you changed `el`:
81+
82+
```html
83+
<!-- index.html -->
84+
85+
<div data-app id="main">Please wait...</div>
86+
87+
<script>
88+
window.$docsify = {
89+
el: '#main'
90+
}
91+
</script>
92+
```
93+
94+
Compare [el configuration](configuration.md#el).

0 commit comments

Comments
 (0)