Merge pull request #1701 from spotify/mob/techdocs-cli-updates
TechDocs: techdocs cli updates
This commit is contained in:
@@ -4,45 +4,31 @@ Check out the [TechDocs README](https://github.com/spotify/backstage/blob/master
|
||||
|
||||
**WIP: This cli is a work in progress. It is not ready for use yet. Follow our progress on [the Backstage Discord](https://discord.gg/MUpMjP2) under #docs-like-code or on [our GitHub Milestone](https://github.com/spotify/backstage/milestone/15).**
|
||||
|
||||
## Commands
|
||||
## Prerequisities
|
||||
|
||||
Run the following command from the project root:
|
||||
|
||||
```bash
|
||||
# Serve localhost:3000 (and localhost:8000)
|
||||
yarn serve
|
||||
|
||||
# Serve localhost:8000 containing your Mkdocs documentation.
|
||||
yarn serve:mkdocs
|
||||
yarn install
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
## Run TechDocs CLI
|
||||
|
||||
You'll need Docker installed and running to use this. You will also need to build the container located at `/packages/techdocs-container` under the tag `mkdocs:local-dev`, as you can see in the commands from below:
|
||||
|
||||
```bash
|
||||
docker build packages/techdocs-container -t mkdocs:local-dev
|
||||
```
|
||||
|
||||
From that point, you can invoke the CLI from any project with a docs folder. Try out our example!
|
||||
You'll need Docker installed and running to use this.
|
||||
|
||||
```bash
|
||||
cd packages/techdocs-container/mock-docs
|
||||
npx @techdocs/cli serve
|
||||
|
||||
# To get a view of your docs in Backstage, use:
|
||||
npx techdocs-cli serve
|
||||
|
||||
# To view the raw mkdocs site (without Backstage), use:
|
||||
npx techdocs-cli serve:mkdocs
|
||||
```
|
||||
|
||||
## Local Development
|
||||
If you run `npx techdocs-cli serve` you should have a `localhost:3000` serving TechDocs in Backstage, as well as `localhost:8000` serving Mkdocs (which won't open up and be exposed to the user).
|
||||
|
||||
You'll need Docker installed and running to use this. You will also need to build the container located at `packages/techdocs-container` under the tag `mkdocs:local-dev` (for now until we deploy the container to a centralized Docker registry), as you can see in the commands from below:
|
||||
|
||||
```bash
|
||||
docker build packages/techdocs-container -t mkdocs:local-dev
|
||||
```
|
||||
|
||||
```bash
|
||||
cd packages/techdocs-container/mock-docs
|
||||
npx techdocs serve
|
||||
```
|
||||
|
||||
You should have a `localhost:3000` serving TechDocs in Backstage, as well as `localhost:8000` serving Mkdocs (which won't open up and be exposed to the user).
|
||||
If running `npx techdocs-cli serve:mkdocs` you will have `localhost:8000` exposed, serving Mkdocs.
|
||||
|
||||
Happy hacking!
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"start": "nodemon --"
|
||||
},
|
||||
"bin": {
|
||||
"techdocs": "bin/techdocs-cli"
|
||||
"techdocs-cli": "bin/techdocs-cli"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@spotify/eslint-config": "^7.0.0",
|
||||
|
||||
@@ -68,7 +68,7 @@ const runMkdocsServer = (options?: {
|
||||
'$(pwd):/content',
|
||||
'-p',
|
||||
'8000:8000',
|
||||
'mkdocs:local-dev',
|
||||
'spotify/techdocs',
|
||||
'serve',
|
||||
'-a',
|
||||
devAddr,
|
||||
|
||||
@@ -9,7 +9,7 @@ This is the Docker container that powers the creation of static documentation si
|
||||
Using the TechDocs CLI, we can invoke the latest version of `techdocs-container` via Docker Hub:
|
||||
|
||||
```bash
|
||||
npx @techdocs/cli serve
|
||||
npx techdocs-cli serve
|
||||
```
|
||||
|
||||
## Local Development
|
||||
|
||||
Reference in New Issue
Block a user