2024-12-16 20:55:00 +00:00
|
|
|
# Backstage docs local
|
|
|
|
|
2025-03-10 11:24:46 +00:00
|
|
|
Take this repo and run a local Backstage harness when you want to edit documentation independently of a central docs repo.
|
2024-12-16 20:55:00 +00:00
|
|
|
|
|
|
|
For the PoC doc you first can *prepare* your docs here.
|
|
|
|
Later on they will go into a central docs repo.
|
|
|
|
Then the cebntral docs repo will render and publish the docs into a running backstage app in a eDF platform.
|
|
|
|
|
|
|
|
## How to
|
|
|
|
|
|
|
|
You need nodejs and npx.
|
|
|
|
|
|
|
|
### Use devbox if you want to keep your host clean
|
|
|
|
|
|
|
|
If you need a devboxed nodejs environment, have [devbox installed](https://www.jetify.com/docs/devbox/installing_devbox/). Then run
|
|
|
|
|
|
|
|
```bash
|
2025-03-10 11:24:46 +00:00
|
|
|
# in this folder
|
|
|
|
|
2024-12-16 20:55:00 +00:00
|
|
|
devbox shell
|
|
|
|
```
|
|
|
|
|
2025-03-10 11:24:46 +00:00
|
|
|
Now npx is available, next run
|
2024-12-16 20:55:00 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# in the repo root dir
|
|
|
|
|
|
|
|
# use backstage theme and frame
|
|
|
|
npx @techdocs/cli serve
|
|
|
|
|
2025-03-10 11:24:46 +00:00
|
|
|
# hint: add 'npx --force --libc=glibc' if the nodejs install hangs
|
|
|
|
# npx --verbose --force --libc=glibc @techdocs/cli serve
|
|
|
|
|
2024-12-16 20:55:00 +00:00
|
|
|
#use mkdocs theme
|
|
|
|
npx @techdocs/cli serve:mkdocs
|
|
|
|
```
|
|
|
|
|
2025-03-10 11:24:46 +00:00
|
|
|
and you will get
|
|
|
|
|
2024-12-16 20:55:00 +00:00
|
|
|
### Output
|
|
|
|
|
|
|
|
You should see this screen:
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
## how this repo was generated
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# get mocked content from techdocs-container (backsatge/packages/techdocs-cli is too slow to clone)
|
|
|
|
mkdir tmp && cd tmp
|
|
|
|
git clone https://github.com/backstage/techdocs-container.git
|
|
|
|
cp -a mock-docs/* ..
|
|
|
|
cd ..
|
|
|
|
rm -rf tmp
|
|
|
|
|
|
|
|
# provide nodejs env
|
|
|
|
devbox init
|
|
|
|
devbox add yarn nodejs
|
|
|
|
```
|