Skip to content

Commit 06b2cf7

Browse files
Eric-Arellanoaxelhzf1ucian0
authored
Add local docs preview for IBM contributors (Qiskit#54)
Closes Qiskit#1. Running `./start` will open up the One Docs app at localhost:3000 using content from the local repository. Currently, you have to log into IBM Cloud and have the correct permissions. We will improve this with Qiskit#53. --------- Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com> Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
1 parent dd9809b commit 06b2cf7

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,31 @@ The documentation content home for https://docs.quantum-computing.ibm.com. Refer
88

99
These tools will also run in CI. But, it can be convenient when iterating to run the tools locally.
1010

11-
First, install the below:
11+
Currently, this workflow only works for IBM maintainers. We are prioritizing fixing this workflow so that anyone can run the tools locally, tracked by https://github.com/Qiskit/docs/issues/53.
12+
13+
First, install the below software:
1214

1315
1. [Node.js](https://nodejs.org/en). If you expect to use JavaScript in other projects, consider using [NVM](https://github.com/nvm-sh/nvm). Otherwise, consider using [Homebrew](https://formulae.brew.sh/formula/node) or installing [Node.js directly](https://nodejs.org/en).
16+
2. [IBM Cloud command line](https://cloud.ibm.com/docs/cli?topic=cli-getting-started)
17+
3. [Docker](https://www.docker.com). You must also ensure that it is running.
18+
* You can use [Colima](https://github.com/abiosoft/colima) or [Rancher Desktop](https://rancherdesktop.io). When installing Rancher Desktop, choose Moby/Dockerd as the engine, rather than nerdctl. To ensure it's running, open up the app "Rancher Desktop".
19+
20+
Set up IBM Cloud to access the Docker image:
21+
22+
1. `ibmcloud plugin install cr`
23+
2. `ibmcloud cr region-set global`
24+
3. Make sure Docker is running, then `ibmcloud cr login`
1425

15-
Then, install the dependencies with:
26+
Finally, install the dependencies with:
1627

1728
```bash
1829
npm install
1930
```
2031

32+
## Preview the docs locally
33+
34+
Run `./start` in your terminal, then open http://localhost:3000 in your browser.
35+
2136
## Spellcheck
2237

2338
We use [cSpell](https://cspell.org) to check for spelling. The `lint` job in CI will fail if there are spelling issues.

start

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
# This code is a Qiskit project.
3+
#
4+
# (C) Copyright IBM 2023.
5+
#
6+
# This code is licensed under the Apache License, Version 2.0. You may
7+
# obtain a copy of this license in the LICENSE file in the root directory
8+
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
9+
#
10+
# Any modifications or derivative works of this code must retain this
11+
# copyright notice, and modified files need to carry a notice indicating
12+
# that they have been altered from the originals.
13+
14+
docker run \
15+
-v "$(pwd)"/docs:/home/node/app/docs \
16+
-v "$(pwd)"/public/images:/home/node/app/public/images \
17+
-p 3000:3000 \
18+
-p 5001:5001 \
19+
icr.io/quantum-computing/iqp-channel-docs-dev

0 commit comments

Comments
 (0)