+++**2. Initialize a new Project (or Start with an existing Project)**++
+
+
+
+
+Navigate into an empty directory and run the following command to initialize a skeletal MarkBind site in that directory. It will create several new files in the directory e.g., `index.md`, `site.json`.
+
+```
+markbind init
+```
+
+
+
+You can add the `--help` flag to any command to show the help screen.
+ e.g., `markbind init --help`
+
+
+
+
+The `init` command populates the project with the [default project template](https://markbind-init-typical.netlify.com/). Refer to [templates](templates.html) section to learn how to use a different template.
+
+
+
+
+
+
+Navigate to the project {{ tooltip_root_directory }}.
+
+
+
+
+++**3. Preview the site**++
+
+Run the following command in the same directory. It will generate a website from your source files, start a web server, and open a live preview of your site in your default Browser.
+
+
+
+
+
+```
+markbind serve
+```
+
+Do some changes to the `index.md` and save the file. The live preview in the Browser should update automatically to reflect your changes.
+
+To stop the web server, go to the console running the `serve` command and press CTRL + C (or the equivalent in your OS).
+
+
+
+++**4. Next steps**++
+
+1. **Update the content of your site**. More info can be found in the [_User Guide: Authoring Contents_](authoringContents.html) section
+1. **Deploy your site**. More info can be found in the [_User Guide: Deploying the Site_](deployingTheSite.html) section.
+
+
+
+++**5. Updating your MarkBind version**++
+
+After you have installed MarkBind, you may want to update to the latest version of MarkBind in the future.
+
+```
+npm install -g markbind-cli@latest
+```
+
+To update to a specific version of MarkBind, replace `latest` with the version number e.g., `5.0.2`.
+
+```
+npm install -g markbind-cli@5.0.2
+```
+
+If you are using any CI/CD tools, ensure the version of MarkBind is updated in the CI/CD pipeline as well.
+- For example, update your GitHub Actions workflow file to use the correct version of MarkBind, if you are using [markbind-action](https://github.com/MarkBind/markbind-action).
+
+---
+
+## Method 2: Install MarkBind locally as a dev-dependency in `package.json`
+
+
+
+This method is recommended if you
+- are creating a documentation site that more than one person will be working on
+- want to specify the version of MarkBind to use in your project and manage it via `package.json`
+
++**1. Initialize a `package.json` file**++
-:glyphicon-hand-right: _If you already have a `package.json` file, skip to the next step._
+:glyphicon-hand-right: _If you already have a `package.json` file, skip to step 2._
+
+:glyphicon-hand-right: _If you are working on a MarkBind project that is set up with this method, run `npm ci` to install the dependencies and refer to step 3 for how to run MarkBind commands._
To initialize a npm project in your current working directory, run the following command.
```
-$ npm init
+npm init
```
You will need to answer the prompts to create a `package.json` file.
@@ -80,7 +152,7 @@ You will need to answer the prompts to create a `package.json` file.
To get a default `package.json` file, run the following command.
```
-$ npm init -y
+npm init -y
```
You can always adjust the content of your `package.json` later.
@@ -90,7 +162,7 @@ You can always adjust the content of your `package.json` later.
++**2. Install markbind-cli locally as a dev-dependency**++
```
-$ npm install markbind-cli --save-dev
+npm install markbind-cli --save-dev
```
++**3. Add scripts in the `package.json` file**++
@@ -115,61 +187,72 @@ You are now ready to run MarkBind commands with `npm run xxx` (e.g. `npm run ini
If you are using Git to version control your source files, view the [_User Guide: .gitignore File_](gitignoreFile.html) section for more info.