diff --git a/README.md b/README.md index 47676369..fd5484b9 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,11 @@ MIT License - - Codecov coverage badge + + Codecov coverage badge - - api-docs-tooling scorecard badge + + doc-kit scorecard badge CII Best Practices badge @@ -35,6 +35,10 @@ Local invocation: $ npx doc-kit --help ``` +```sh +$ node bin/cli.mjs --help +``` + ``` Usage: @nodejs/doc-kit [options] [command] @@ -78,3 +82,38 @@ Launch guided CLI wizard Options: -h, --help display help for command ``` + +## Examples + +### Legacy + +To generate a 1:1 match with the [legacy tooling](https://github.com/nodejs/node/tree/main/tools/doc), use the `legacy-html`, `legacy-json`, `legacy-html-all`, and `legacy-json-all` generators. + +```sh +npx doc-kit generate \ + -t legacy-html \ + -t legacy-json \ + -i "path/to/node/doc/api/*.md" \ + -o out \ + --index path/to/node/doc/api/index.md +``` + +### Redesigned + +To generate [our redesigned documentation pages](https://nodejs-api-doc-tooling.vercel.app), use the `web` and `orama-db` (for search) generators. + +```sh +npx doc-kit generate \ + -t web \ + -t orama-db \ + -i "path/to/node/doc/api/*.md" \ + -o out \ + --index path/to/node/doc/api/index.md +``` + +> [!TIP] +> In order to use the search functionality, you _must_ serve the output directory. +> +> ```sh +> npx serve out +> ```