Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve User Guide - Getting Started and .gitignore file #1924

Merged
merged 1 commit into from
May 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_markbind/layouts/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* [Full Syntax Reference]({{baseUrl}}/userGuide/fullSyntaxReference.html)
* [Syntax Cheat Sheet]({{baseUrl}}/userGuide/syntaxCheatSheet.html)
* [`site.json` File]({{baseUrl}}/userGuide/siteJsonFile.html)
* [`.gitignore` File]({{baseUrl}}/userGuide/gitignoreFile.html)
* [Tips & Tricks]({{baseUrl}}/userGuide/tipsAndTricks.html)
* [Troubleshooting]({{baseUrl}}/userGuide/troubleshooting.html)
* [Glossary]({{baseUrl}}/userGuide/glossary.html)
Expand Down
83 changes: 82 additions & 1 deletion docs/userGuide/gettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,29 @@
%%{{ icon_ticked }}%% [Node.js](https://nodejs.org) {{ node_version }} or higher installed
</div>

<box type="tip" header="##### Quick Start :rocket:" >

Initialize a MarkBind site:

```{.line-numbers}
npx markbind-cli init mySite
```

Preview the site:

```{.line-numbers}
cd mySite
npx markbind-cli serve
```

See usage information:

```{.line-numbers}
npx markbind-cli --help
```

</box>

++**1. Install MarkBind**++

Run the following command to install MarkBind.
Expand All @@ -35,9 +58,67 @@ $ markbind
| | | | | (_| | | | | < | |_) | | | | | | | | (_| |
|_| |_| \__,_| |_| |_|\_\ |____/ |_| |_| |_| \__,_|

v2.x.y
v3.x.y
Usage: ...
```

<panel header="Alternative installation: as a local dev-dependency with `package.json`">

++**1. Initialize a `package.json` file**++

:glyphicon-hand-right: _If you already have a `package.json` file, skip to the next step._

To initialize a npm project in your current working directory, run the following command.

```
$ npm init
```
You will need to answer the prompts to create a `package.json` file.

<box type="tip" light>

To get a default `package.json` file, run the following command.

```
$ npm init -y
```

You can always adjust the content of your `package.json` later.

</box>

++**2. Install markbind-cli locally as a dev-dependency**++

```
$ npm install markbind-cli --save-dev
```

++**3. Add scripts in the `package.json` file**++

To make the commands available via `npm run`, add the following scripts to your `package.json`.

```json
"scripts": {
"init": "markbind init",
"build": "markbind build",
"serve": "markbind serve",
"deploy": "markbind deploy"
}
```

You are now ready to run MarkBind commands with `npm run xxx` (e.g. `npm run init` for `markbind init`).

* Alternatively, you can use `npx` to run the commands with `npx markbind-cli xxx` (e.g. `npx markbind-cli init` for `markbind init`).

<box type="info" seamless>

If you are using Git to version control your source files, view the [_User Guide: .gitignore File_](gitignoreFile.html) section for more info.
</box>

</panel>

<br>

++**2. Initialize a new Project (or Start with an existing Project)**++

<tabs>
Expand Down
47 changes: 47 additions & 0 deletions docs/userGuide/gitignoreFile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{% set title = ".gitignore" %}
<span id="title" class="d-none">{{ title }}</span>

<frontmatter>
title: "User Guide: {{ title | safe }}"
layout: userGuide.md
keywords: .gitignore
pageNav: 5
</frontmatter>

# {{ title | safe }}

If you are using [Git](https://git-scm.com/) to manage your project, you can use a `.gitignore` file to ignore files that you don't want to be tracked by Git.

Some common files to ignore in a MarkBind project are:

* log files
* build output
* dependencies such as `node_modules`

The following is a sample `.gitignore` file for typical MarkBind projects:

``` {heading=".gitignore"}
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
_markbind/logs/

# Dependency directories
node_modules/

# Production build files (change if you output the build to a different directory)
_site/

# Env
.env
.env.local

# IDE configs
.vscode/
.idea/*
*.iml
```