# Getting Started
::: warning COMPATIBILITY NOTE MdPress requires Node.js >= 8. :::
# Global Installation
If you only want to play around with MdPress, you can install it globally:
# install globally
yarn global add mdpress # OR npm install -g mdpress
# create the project folder
mkdir mdpress-starter && cd mdpress-starter
# create a markdown file
echo '# Hello MdPress' > README.md
# start writing
mdpress dev
# build
mdpress build
# Inside an Existing Project
If you have an existing project and would like to keep documentation inside the project, you should install MdPress as a local dependency. This setup also allows you to use CI or services like Netlify for automatic deployment on push.
# install as a local dependency
yarn add -D mdpress # OR npm install -D mdpress
# create a docs directory
mkdir docs
# create a markdown file
echo '# Hello MdPress' > docs/README.md
::: warning We currently recommend using Yarn instead of npm when installing MdPress into an existing project that has webpack 3.x as a dependency, because npm fails to generate the correct dependency tree in this case. :::
Then, add some scripts to package.json
:
{
"scripts": {
"docs:dev": "mdpress dev docs",
"docs:build": "mdpress build docs"
}
}
You can now start writing with:
yarn docs:dev # OR npm run docs:dev
To generate static assets, run:
yarn docs:build # OR npm run docs:build
By default, the built files will be in .mdpress/dist
, which can be configured via the dest
field in .mdpress/config.js
. The built files can be deployed to any static file server. See Deployment Guide for guides on deploying to popular services.