Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Mar 24, 2024
1 parent 227f885 commit c060d68
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build and Deploy to Preview

on:
push:
branches:
Expand Down
46 changes: 37 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,62 @@ Documentation sources for [nightwatchjs.org](http://nightwatchjs.org) website.

***

## Development
## Overview

The content is written in Markdown and it is located in the `docs` folder. The individual API command pages are generated from the Nightwatch source code. based on the JSDoc comments.
The website is built with **PostDoc** (a static site generator built with Vite and EJS). It supports Markdown, EJS, and front matter. It comes with a dev server with Hot module replacement (HMR).

The content is written in Markdown and it is located in the `docs` folder. The individual API command pages are generated from the Nightwatch source code. based on the JSDoc comments.

### Run the website locally

The website is built with **PostDoc** (a static site generator built with Vite and EJS). It supports Markdown, EJS, and front matter.
It comes with a dev server with Hot module replacement (HMR).
First, simply clone the repository and install the dependencies.

```bash
git clone https://github.com/nightwatchjs/nightwatch-docs.git
npm install
```

### Configuration

The website configuration is located in the `postdoc.config.js` file. In order to run the website locally, you need to have the Nightwatch source code repo clones and then specify the path to it in the `postdoc.config.js` file.
Since the API documentation is generated directly from source code, you need to have the Nightwatch source code cloned locally.

#### Step 1: Clone the Nightwatch repository

```bash
git clone https://github.com/nightwatchjs/nightwatch.git
npm install
```

#### Step 2: Configure the path to the Nightwatch repository

Next, you have specify the path to where the api commands are in the `postdoc.config.js` file. You can also set the `API_DOCS_FOLDER` environment variable.

```js
// postdoc.config.js
export default {
apidocs: {
source: '/path/to/nightwatch/lib/api/'
}
```
You can also set the `API_DOCS_FOLDER` environment variable to specify the path. You can also disable the API docs generation by setting the `apidocs` property to `false` in the `postdoc.config.js` file, e.g.:
You can also disable the API docs generation by setting the `apidocs` property to `false` in the `postdoc.config.js` file:
```js
// postdoc.config.js
export default {
apidocs: false
}
```
### Installation
### Run the website dev server
```bash
npm install
npm start
```
The website will be available at `http://127.0.0.1:5173/`.


### PostDoc CLI

To view the available options, run:
Expand All @@ -67,7 +95,7 @@ To build the website, run:
npm run build
```

The generated files will be in the `out` folder.
The generated files will be in the `out` folder.

Quickly serve the generated files with:

Expand Down

0 comments on commit c060d68

Please sign in to comment.