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

Add npm script docs #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,37 @@ require('hazelcast-docs-tools/scripts/orphan-pages-checker');
```

### Executables
Executables are installed inside the `node_modules/.bin`, so they can be called directly e.g. in npm scripts:
Executables are installed inside the `node_modules/.bin`, so they can be called directly from the command line. E.g.:

```shell
./node_modules/.bin/check-orphan-pages
```
You can also pass the command line arguments

```shell
./node_modules/.bin/check-orphan-pages -d tutorials --log-failure-level error
```

Or they can be called as `npm` scripts. For that to work you need to add the `check-orphan-pages` command to the `scripts` section of the `package.json`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason not to include this in the package.json file in the repo now?


```json
"check-orphan-pages": "check-orphan-pages",
{
"scripts": {
"check-orphan-pages": "check-orphan-pages"
}
}
```

Then you can launch the check as following:

```shell
npm run check-orphan-pages
```

Or you can also pass arguments to the command of the `npm` script using `--` before the arguments list:

```shell
npm run check-orphan-pages -- --log-failure-level error
```

## Tools
Expand All @@ -59,8 +86,8 @@ The `check-orphan-pages` command takes the following arguments

| Name | Description | Default Value |
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------|---------------|
| `--directory`, `-d` | set the root folder of documentation, if there are several root directories, can take a coma separated list, e.g. `-d docs,tutorials` | `"docs"` |
| `--log-failure-level` | if set to `"error"` exits process with `1` if orphan pages are detected | `undefined` |
| `--directory`, `-d` | set the root folder of documentation, if there are several root directories, can take a coma separated list, e.g. `-d docs,tutorials` | `docs` |
| `--log-failure-level` | if set to `error` exits process with `1` if orphan pages are detected | `undefined` |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want this to be the default behavior once we've tested it on all the repos, but sensible to avoid breaking builds for now.


### Check Links Playbook Loader
The `load-check-links-playbook` command takes the following arguments
Expand Down