Skip to content

Commit 94021e2

Browse files
authored
Merge pull request #574 from PeterDaveHello/README.md-Table-of-Contents
Add "Table of Contents" in README.md
2 parents be5de23 + 0864b06 commit 94021e2

File tree

2 files changed

+86
-60
lines changed

2 files changed

+86
-60
lines changed

README.md

Lines changed: 83 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,34 +14,32 @@ Still in the early stage, feel free to fork or contribute to HackMD.
1414

1515
Thanks for using! :smile:
1616

17-
[docker-hackmd](https://github.com/hackmdio/docker-hackmd)
18-
---
19-
20-
Before you go too far, here is the great docker repo for HackMD.
21-
With docker, you can deploy a server in minutes without any downtime.
22-
23-
Heroku Deployment
24-
---
25-
26-
You can quickly setup a sample heroku hackmd application by clicking the button below.
27-
28-
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
29-
30-
[migration-to-0.5.0](https://github.com/hackmdio/migration-to-0.5.0)
31-
---
32-
33-
We don't use LZString to compress socket.io data and DB data after version 0.5.0.
34-
Please run the migration tool if you're upgrading from the old version.
35-
36-
[migration-to-0.4.0](https://github.com/hackmdio/migration-to-0.4.0)
37-
---
38-
39-
We've dropped MongoDB after version 0.4.0.
40-
So here is the migration tool for you to transfer the old DB data to the new DB.
41-
This tool is also used for official service.
42-
43-
Browsers Requirement
44-
---
17+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
18+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
19+
# Table of Contents
20+
21+
- [Browsers Requirement](#browsers-requirement)
22+
- [Installation](#installation)
23+
- [Getting started (Native install)](#getting-started-native-install)
24+
- [Prerequisite](#prerequisite)
25+
- [Instructions](#instructions)
26+
- [Heroku Deployment](#heroku-deployment)
27+
- [HackMD by docker container](#hackmd-by-docker-container)
28+
- [Upgrade](#upgrade)
29+
- [Native setup](#native-setup)
30+
- [Configuration](#configuration)
31+
- [Environment variables (will overwrite other server configs)](#environment-variables-will-overwrite-other-server-configs)
32+
- [Application settings `config.json`](#application-settings-configjson)
33+
- [Third-party integration api key settings](#third-party-integration-api-key-settings)
34+
- [Third-party integration oauth callback urls](#third-party-integration-oauth-callback-urls)
35+
- [Developer Notes](#developer-notes)
36+
- [Structure](#structure)
37+
- [Operational Transformation](#operational-transformation)
38+
- [License](#license)
39+
40+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
41+
42+
# Browsers Requirement
4543

4644
- Chrome >= 47, Chrome for Android >= 47
4745
- Safari >= 9, iOS Safari >= 8.4
@@ -50,15 +48,17 @@ Browsers Requirement
5048
- Opera >= 34, Opera Mini not supported
5149
- Android Browser >= 4.4
5250

53-
Prerequisite
54-
---
51+
# Installation
52+
53+
## Getting started (Native install)
54+
55+
### Prerequisite
5556

5657
- Node.js 6.x or up (test up to 7.5.0)
5758
- Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset `utf8`
5859
- npm (and its dependencies, especially [uWebSockets](https://github.com/uWebSockets/uWebSockets#nodejs-developers), [node-gyp](https://github.com/nodejs/node-gyp#installation))
5960

60-
Get started
61-
---
61+
### Instructions
6262

6363
1. Download a release and unzip or clone into a directory
6464
2. Enter the directory and type `bin/setup`, which will install npm dependencies and create configs. The setup script is written in Bash, you would need bash as a prerequisite.
@@ -67,8 +67,22 @@ Get started
6767
5. Build front-end bundle by `npm run build` (use `npm run dev` if you are in development)
6868
6. Run the server as you like (node, forever, pm2)
6969

70-
Upgrade guide
71-
---
70+
## Heroku Deployment
71+
72+
You can quickly setup a sample heroku hackmd application by clicking the button below.
73+
74+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
75+
76+
## HackMD by docker container
77+
78+
[docker-hackmd](https://github.com/hackmdio/docker-hackmd)
79+
80+
Before you go too far, here is the great docker repo for HackMD.
81+
With docker, you can deploy a server in minutes without any downtime.
82+
83+
# Upgrade
84+
85+
## Native setup
7286

7387
If you are upgrading HackMD from an older version, follow these steps:
7488

@@ -81,32 +95,26 @@ If you are upgrading HackMD from an older version, follow these steps:
8195
6. Run `node_modules/.bin/sequelize db:migrate`, this step will migrate your db to the latest schema
8296
7. Start your whole new server!
8397

84-
Structure
85-
---
98+
* [migration-to-0.5.0](https://github.com/hackmdio/migration-to-0.5.0)
8699

87-
```text
88-
hackmd/
89-
├── tmp/ --- temporary files
90-
├── docs/ --- document files
91-
├── lib/ --- server libraries
92-
└── public/ --- client files
93-
├── css/ --- css styles
94-
├── js/ --- js scripts
95-
├── vendor/ --- vendor includes
96-
└── views/ --- view templates
97-
```
100+
We don't use LZString to compress socket.io data and DB data after version 0.5.0.
101+
Please run the migration tool if you're upgrading from the old version.
102+
103+
* [migration-to-0.4.0](https://github.com/hackmdio/migration-to-0.4.0)
104+
105+
We've dropped MongoDB after version 0.4.0.
106+
So here is the migration tool for you to transfer the old DB data to the new DB.
107+
This tool is also used for official service.
98108

99-
Configuration files
100-
---
109+
# Configuration
101110

102111
There are some configs you need to change in the files below
103112

104113
```
105114
./config.json ----application settings
106115
```
107116

108-
Environment variables (will overwrite other server configs)
109-
---
117+
## Environment variables (will overwrite other server configs)
110118

111119
| variables | example values | description |
112120
| --------- | ------ | ----------- |
@@ -160,8 +168,7 @@ Environment variables (will overwrite other server configs)
160168
| HMD_HSTS_MAX_AGE | `31536000` | max duration in seconds to tell clients to keep HSTS status (default is a year) |
161169
| HMD_HSTS_PRELOAD | `true` | whether to allow preloading of the site's HSTS status (e.g. into browsers) |
162170

163-
Application settings `config.json`
164-
---
171+
## Application settings `config.json`
165172

166173
| variables | example values | description |
167174
| --------- | ------ | ----------- |
@@ -205,17 +212,15 @@ Application settings `config.json`
205212
| s3 | `{ "accessKeyId": "YOUR_S3_ACCESS_KEY_ID", "secretAccessKey": "YOUR_S3_ACCESS_KEY", "region": "YOUR_S3_REGION" }` | When `imageUploadType` be set to `s3`, you would also need to setup this key, check our [S3 Image Upload Guide](docs/guides/s3-image-upload.md) |
206213
| s3bucket | `YOUR_S3_BUCKET_NAME` | bucket name when `imageUploadType` is set to `s3` |
207214

208-
Third-party integration api key settings
209-
---
215+
## Third-party integration api key settings
210216

211217
| service | settings location | description |
212218
| ------- | --------- | ----------- |
213219
| facebook, twitter, github, gitlab, dropbox, google, ldap | environment variables or `config.json` | for signin |
214220
| imgur | environment variables or `config.json` | for image upload |
215221
| google drive(`google/apiKey`, `google/clientID`), dropbox(`dropbox/appKey`) | `config.json` | for export and import |
216222

217-
Third-party integration oauth callback urls
218-
---
223+
## Third-party integration oauth callback urls
219224

220225
| service | callback url (after the server url) |
221226
| ------- | --------- |
@@ -226,14 +231,33 @@ Third-party integration oauth callback urls
226231
| dropbox | `/auth/dropbox/callback` |
227232
| google | `/auth/google/callback` |
228233

229-
Operational Transformation
230-
---
234+
# Developer Notes
235+
236+
## Structure
237+
238+
```text
239+
hackmd/
240+
├── tmp/ --- temporary files
241+
├── docs/ --- document files
242+
├── lib/ --- server libraries
243+
└── public/ --- client files
244+
├── css/ --- css styles
245+
├── js/ --- js scripts
246+
├── vendor/ --- vendor includes
247+
└── views/ --- view templates
248+
```
249+
250+
## Operational Transformation
231251

232252
From 0.3.2, we started supporting operational transformation.
233253
It makes concurrent editing safe and will not break up other users' operations.
234254
Additionally, now can show other clients' selections.
235255
See more at [http://operational-transformation.github.io/](http://operational-transformation.github.io/)
236256

257+
258+
259+
# License
260+
237261
**License under MIT.**
238262

239263
[gitter-image]: https://badges.gitter.im/Join%20Chat.svg

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"dev": "webpack --config webpack.config.js --progress --colors --watch",
1212
"build": "webpack --config webpack.production.js --progress --colors --bail",
1313
"postinstall": "bin/heroku",
14-
"start": "node app.js"
14+
"start": "node app.js",
15+
"doctoc": "doctoc --title='# Table of Contents' README.md"
1516
},
1617
"dependencies": {
1718
"Idle.Js": "git+https://github.com/shawnmclean/Idle.js",
@@ -152,6 +153,7 @@
152153
"babel-runtime": "^6.20.0",
153154
"copy-webpack-plugin": "^4.0.1",
154155
"css-loader": "^0.26.1",
156+
"doctoc": "^1.3.0",
155157
"ejs-loader": "^0.3.0",
156158
"exports-loader": "^0.6.3",
157159
"expose-loader": "^0.7.1",

0 commit comments

Comments
 (0)