techdocs-cli

Usage
See techdocs-cli usage docs.
Development
NOTE: When we build techdocs-cli
it copies the output techdocs-cli-embedded-app
bundle into the packages/techdocs-cli/dist
which is then published with the
@techdocs/cli
npm package.
Running
yarn workspace @techdocs/cli build
packages/techdocs-cli/bin/techdocs-cli
export PATH=/path/to/backstage/packages/techdocs-cli/bin:$PATH
If you want to test live test changes to the packages/techdocs-cli-embedded-app
you can serve the app and run the CLI using the following commands:
cd packages/techdocs-cli-embedded-app
yarn start
yarn techdocs-cli:dev [...options]
Using an example docs project
For the purpose of local development, we have created an example documentation project. You are of course also free to create your own local test site - all it takes is a docs/index.md
and an mkdocs.yml
in a directory.
cd packages/techdocs-cli/src/example-docs
techdocs-cli serve
techdocs-cli serve:mkdocs
Testing
E2E tests
Running unit tests requires mkdocs to be installed locally:
pip install mkdocs
pip install mkdocs-techdocs-core
Then run yarn test
.
Cypress (Integration and Visual regression) tests
Running cypress tests requires you to run the CLI locally against our example docs.
Run the local version of techdocs-cli against the example docs:
yarn build --scope @techdocs/cli
cd packages/techdocs-cli/src/example-docs
../../bin/techdocs-cli serve
In another shell, run the cypress tests:
cd packages/techdocs-cli
yarn test:cypress
This will launch a cypress app where you can run the two different tests:
backstage_serve
- will run against the backstage servermkdocs_serve
- will run test against the mkdocs server
If its the first time you run Cypress, it will run a "Verifying Cypress can run" step. This step can result in a "Cypress verification timed out" error. If that is the case, let the verification step run and then run the command again and it should succeed.