This is a fork of the great hackmd.io. We just thought it would be even greater with AsciiDoctor and so we included Asciidoctor.js into the project and changed its name accordingly ;)
Thanks to Asciidoc.js, the base functionality (typing AsciiDoc and seeing a nice rendered document) works fine. You can also upload and embed images without a problem.
But there are certaily many things missing, so please feel free to report those you encounter as issues or provide a pull request.
Known drawbacks are:
-
syntax highlighting in the editor (eg. marking bold formatted text as bold within the editor) still uses the md syntax, see Issue #1
-
the menue has not been adjusted
-
Publish seems to be broken
-
TOC plugin does not reflect the actual TOC , see Issue #16
-
Auto-Completion by typing [ does not work as expected , see Issue #17, see Issue #30
You can find a complete and up-to-date list at open issues.
HackMD lets you create realtime collaborative markdown notes on all platforms. Inspired by Hackpad, with more focus on speed and flexibility. Still in the early stage, feel free to fork or contribute to HackMD.
Thanks for using! π
Before you go too far, here is the great docker repo for HackMD. With docker, you can deploy a server in minutes without any downtime.
You can quickly setup a sample heroku hackmd application by clicking the button below.
We donβt use LZString to compress socket.io data and DB data after version 0.5.0. Please run the migration tool if youβre upgrading from the old version.
Weβve dropped MongoDB after version 0.4.0. So here is the migration tool for you to transfer the old DB data to the new DB. This tool is also used for official service.
-
Chrome >= 47, Chrome for Android >= 47
-
Safari >= 9, iOS Safari >= 8.4
-
Firefox >= 44
-
IE >= 9, Edge >= 12
-
Opera >= 34, Opera Mini not supported
-
Android Browser >= 4.4
-
Node.js 6.x or up (test up to 7.5.0)
-
Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) use charset
utf8
-
npm (and its dependencies, especially uWebSockets, node-gyp)
-
Download a release and unzip or clone into a directory
-
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. -
Setup the configs, see more below
-
Setup environment variables which will overwrite the configs
-
To use sqlite you need to install
npm install sqlite3
-
-
Build front-end bundle by
npm run build
(usenpm run dev
if you are in development) -
Run the server as you like (node, forever, pm2)
If you are upgrading HackMD from an older version, follow these steps:
-
Fully stop your old server first (important)
-
git pull
or do whatever that updates the files -
npm install
to update dependencies -
Build front-end bundle by
npm run build
(usenpm run dev
if you are in development) -
Modify the file named
.sequelizerc
, change the value of the variableurl
with your db connection string For example:postgres://username:password@localhost:5432/hackmd
-
Run
node_modules/.bin/sequelize db:migrate
, this step will migrate your db to the latest schema -
Start your whole new server!
hackmd/
βββ tmp/ --- temporary files
βββ docs/ --- document files
βββ lib/ --- server libraries
βββ public/ --- client files
βββ css/ --- css styles
βββ js/ --- js scripts
βββ vendor/ --- vendor includes
βββ views/ --- view templates
There are some configs you need to change in the files below
./config.json ----application settings
variables | example values | description |
---|---|---|
NODE_ENV |
|
set current environment (will
apply corresponding settings in the |
DEBUG |
|
set debug mode, show more logs |
HMD_DOMAIN |
|
domain name |
HMD_URL_PATH |
|
sub url path, like |
HMD_PORT |
|
web app port |
HMD_ALLOW_ORIGIN |
|
domain name whitelist (use comma to separate) |
HMD_PROTOCOL_USESSL |
|
set to use ssl protocol for resources path (only applied when domain is set) |
HMD_URL_ADDPORT |
|
set to add port on callback url (port 80 or 443 wonβt applied) (only applied when domain is set) |
HMD_USECDN |
|
set to use CDN resources or not (default
is |
HMD_ALLOW_ANONYMOUS |
|
set to allow anonymous usage
(default is |
HMD_ALLOW_FREEURL |
|
set to allow new note by accessing not exist note url |
HMD_DEFAULT_PERMISSION |
|
set notes default permission (only applied on signed users) |
HMD_DB_URL |
|
set the db url |
HMD_FACEBOOK_CLIENTID |
no example |
Facebook API client id |
HMD_FACEBOOK_CLIENTSECRET |
no example |
Facebook API client secret |
HMD_TWITTER_CONSUMERKEY |
no example |
Twitter API consumer key |
HMD_TWITTER_CONSUMERSECRET |
no example |
Twitter API consumer secret |
HMD_GITHUB_CLIENTID |
no example |
GitHub API client id |
HMD_GITHUB_CLIENTSECRET |
no example |
GitHub API client secret |
HMD_GITLAB_SCOPE |
|
GitLab API requested scope
(default is |
HMD_GITLAB_BASEURL |
no example |
GitLab authentication endpoint, set to use other endpoint than GitLab.com (optional) |
HMD_GITLAB_CLIENTID |
no example |
GitLab API client id |
HMD_GITLAB_CLIENTSECRET |
no example |
GitLab API client secret |
HMD_DROPBOX_CLIENTID |
no example |
Dropbox API client id |
HMD_DROPBOX_CLIENTSECRET |
no example |
Dropbox API client secret |
HMD_GOOGLE_CLIENTID |
no example |
Google API client id |
HMD_GOOGLE_CLIENTSECRET |
no example |
Google API client secret |
HMD_LDAP_URL |
|
url of LDAP server |
HMD_LDAP_BINDDN |
no example |
bindDn for LDAP access |
HMD_LDAP_BINDCREDENTIALS |
no example |
bindCredentials for LDAP access |
HMD_LDAP_TOKENSECRET |
|
secret used for generating access/refresh tokens |
HMD_LDAP_SEARCHBASE |
|
LDAP directory to begin search from |
HMD_LDAP_SEARCHFILTER |
|
LDAP filter to search with |
HMD_LDAP_SEARCHATTRIBUTES |
no example |
LDAP attributes to search with |
HMD_LDAP_TLS_CA |
|
Root CA for LDAP TLS in PEM format (use comma to separate) |
HMD_LDAP_PROVIDERNAME |
|
Optional name to be displayed at login form indicating the LDAP provider |
HMD_IMGUR_CLIENTID |
no example |
Imgur API client id |
HMD_EMAIL |
|
set to allow email signin |
HMD_ALLOW_EMAIL_REGISTER |
|
set to allow email
register (only applied when email is set, default is |
HMD_IMAGE_UPLOAD_TYPE |
|
Where to upload image. For S3, see our S3 Image Upload Guide |
HMD_S3_ACCESS_KEY_ID |
no example |
AWS access key id |
HMD_S3_SECRET_ACCESS_KEY |
no example |
AWS secret key |
HMD_S3_REGION |
|
AWS S3 region |
HMD_S3_BUCKET |
no example |
AWS S3 bucket name |
variables | example values | description |
---|---|---|
debug |
|
set debug mode, show more logs |
domain |
|
domain name |
urlpath |
|
sub url path, like |
port |
|
web app port |
alloworigin |
|
domain name whitelist |
usessl |
|
set to use ssl server (if true will auto
turn on |
protocolusessl |
|
set to use ssl protocol for resources path (only applied when domain is set) |
urladdport |
|
set to add port on callback url (port 80 or 443 wonβt applied) (only applied when domain is set) |
usecdn |
|
set to use CDN resources or not (default is
|
allowanonymous |
|
set to allow anonymous usage
(default is |
allowfreeurl |
|
set to allow new note by accessing not exist note url |
defaultpermission |
|
set notes default permission (only applied on signed users) |
dburl |
|
set the db url, if set this variable then below db config wonβt be applied |
db |
|
set the db configs, see more here |
sslkeypath |
|
ssl key path (only need when you set usessl) |
sslcertpath |
|
ssl cert path (only need when you set usessl) |
sslcapath |
|
ssl ca chain (only need when you set usessl) |
dhparampath |
|
ssl dhparam path (only need when you set usessl) |
tmppath |
|
temp directory path |
defaultnotepath |
|
default note file path |
docspath |
|
docs directory path |
indexpath |
|
index template file path |
hackmdpath |
|
hackmd template file path |
errorpath |
|
error template file path |
prettypath |
|
pretty template file path |
slidepath |
|
slide template file path |
sessionname |
|
cookie session name |
sessionsecret |
|
cookie session secret |
sessionlife |
|
cookie session life |
staticcachetime |
|
static file cache time |
heartbeatinterval |
|
socket.io heartbeat interval |
heartbeattimeout |
|
socket.io heartbeat timeout |
documentmaxlength |
|
note max length |
|
set to allow email signin |
|
allowemailregister |
|
set to allow email register
(only applied when email is set, default is |
imageUploadType |
|
Where to upload image |
s3 |
|
When |
service | settings location | description |
---|---|---|
facebook, twitter, github, gitlab, dropbox, google, ldap |
environment
variables or |
for signin |
imgur |
environment variables or |
for image upload |
google drive( |
|
for export and import |
service | callback url (after the server url) |
---|---|
|
|
|
|
github |
|
gitlab |
|
dropbox |
|
|
From 0.3.2, we started supporting operational transformation. It makes concurrent editing safe and will not break up other usersβ operations. Additionally, now can show other clientsβ selections. See more at http://operational-transformation.github.io/
License under MIT.