Documentation sources for nightwatchjs.org website.
Homepage • Developer Guide • API Reference • About • Blog
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.
First, simply clone the repository and install the dependencies.
git clone https://github.com/nightwatchjs/nightwatch-docs.git
npm install
Since the API documentation is generated directly from source code, you need to have the Nightwatch source code cloned locally.
git clone https://github.com/nightwatchjs/nightwatch.git
npm install
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.
// postdoc.config.js
export default {
apidocs: {
source: '/path/to/nightwatch/lib/api/'
}
You can also disable the API docs generation by setting the apidocs
property to false
in the postdoc.config.js
file:
// postdoc.config.js
export default {
apidocs: false
}
npm start
The website will be available at http://127.0.0.1:5173/
.
To view the available options, run:
npx postdoc --help
npm start -- --open [chrome|firefox|edge|safari]
To build the website, run:
npm run build
The generated files will be in the out
folder.
Quickly serve the generated files with:
npx postdoc preview
MIT