Commit Graph

64 Commits

Author SHA1 Message Date
Eric Arellano e8d3efa5a0 Remove README entry about Composer component (#1655)
This component is unused and being removed.
2024-07-04 14:40:14 +00:00
Eric Arellano 6c4332c4b8 Remove PR previews for now (#1595)
Part of https://github.com/Qiskit/documentation/issues/1043. Code Engine
is shut down tomorrow, so we need to turn off previews for now.

We're still working on what the replacement is. Once that's ready, we'll
revive whichever of these files are relevant.
2024-06-26 19:26:03 +00:00
Eric Arellano bb78af4409 Clean up README link (#1488) 2024-06-04 14:56:05 +00:00
Eric Arellano e4b34274e7 Document how to deploy tutorials (#1450)
See https://github.com/Qiskit/documentation/pull/1403 for the original
PR.

Co-authored-by: Abby Cross <across@us.ibm.com>
2024-05-29 12:41:33 +00:00
Frank Harkins 5ea44f55c7 Ask contributors to use `tox` for final notebook execution. (#1365)
Closes #1239

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-05-14 14:20:09 +00:00
Arnau Casau e59329437e Update readme to include preview instructions (#1334)
The PR adds instructions to the readme to preview changes made for API
docs authors locally.
2024-05-10 14:07:20 +00:00
Eric Arellano ff986fa93f Add Qiskit Transpiler Service Client docs (#1317)
Docs for https://pypi.org/project/qiskit-transpiler-service/.

These docs are not ready to go live to production yet. But we can safely
merge them in this repository to unblock infrastructure work in closed
source. We won't have closed source sync over these files until we get
the final okay from the transpiler service team.
2024-05-08 11:48:14 +00:00
Frank Harkins e224b070eb Mock hardware when testing notebooks (#1184)
This uses the approach discussed in #1174 to test notebooks that submit
jobs to IBM Quantum.

The script behaviour has changed a bit:
* We now have a list of `notebooks_no_mock`, these could include
notebooks with large circuits or that demonstrate features not available
on the fake backend. Future work could partially test these using the
approach in
[#1173](https://github.com/Qiskit/documentation/issues/1173).
* By default, it runs all notebooks except `notebooks_no_mock`, with the
patched package.
* `--submit-jobs` will run **all** notebooks, without the patched
package.
* `--only-unmockable` will run only `notebooks_no_mock`, without the
patched package.

The following notebooks do **not** work with this patch, but some of
them might not have worked anyway.
* `tutorials/variational-quantum-eigensolver/notebook.ipynb`
* `tutorials/submitting-transpiled-circuits/notebook.ipynb`
* `tutorials/build-repitition-codes/notebook.ipynb`

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-05-02 15:50:33 +00:00
abbycross 631be2cd3f Specify command to run Prettier (#1245)
Clarify the options for fixing a file with a Prettier error.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-04-26 18:34:13 +00:00
Frank Harkins 0290bfb588 Make notebook tester into package (#1208)
Makes the notebook tester into an installable package so we can re-use
it in other repos.

Main changes are:
* Adding `pyproject.toml` and moving script to
`qiskit_docs_notebook_tester/__init__.py`
* Moving the lists of notebooks to a config file
* Splitting the requirements needed for running the code in the
notebooks form those neeed by the testing script itself

The interface via `tox` should be unaffected.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-04-24 15:14:49 +00:00
Eric Arellano 6d2832c360 Upgrade Aer to 0.14 (#1127)
Also explain what to install to get the notebooks working locally.
Tested on macOS Apple Silicon. The Linux requirements come from CI but
weren't tested locally.
2024-04-04 18:40:56 +00:00
abbycross 5c9338c28c Create style-guide.md (#1114)
Compiling a list of the most common fixes we make when editing
documentation, for the curious author who might want a reference.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Rebecca Dimock <66339736+beckykd@users.noreply.github.com>
2024-04-03 19:58:41 +00:00
Frank Harkins b00325b0bc Add new cell tag features to README (#1096)
We have a couple more features available via cell tags. See diff for an
explanation.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-03-26 17:47:18 +00:00
Eric Arellano c05e49c282 Upgrade to new staging Docker image (#990)
Closes https://github.com/Qiskit/documentation/issues/74.

We were finally able to get a Docker image working with Code Engine.
Turns out the problem was upgrading from Next.js 13.4 to 13.5 because
Code Engine does not play nicely with 13.4.13 or newer.

The Docker image was so slow because we were under-allocating resources.
We double the resources. It's still somewhat slow, but less laggy than
before. The next step would be to double again, which costs more money,
so I was thinking to start with this for now?

---------

Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
2024-03-26 11:29:24 +00:00
Eric Arellano fce445971a Update instructions for preview now that there's a home page (#1054)
The recently released Preview docker image now has a home page, so
`localhost:3000` no longer 404s. It acts like a table of contents.


![image](https://github.com/Qiskit/documentation/assets/14852634/4153cbc1-aaa0-4e1e-9d39-5b0cd9a1c7ef)


(Users need to run `docker pull qiskit/documentation` to pull in this
change.)
2024-03-19 16:46:08 +00:00
Rebecca Dimock aa681ef41e restructure image (#992)
I thought it would look better this way
2024-03-11 19:45:49 +00:00
Kaelyn Ferris 24f709eb48 Check for orphan pages (#951)
Close #388 

I ended up not using `zxMain` and set a few different options for
choosing which api docs to look through (similar to
`checkPagesRender.ts`). @Eric-Arellano Let me know if there's anything
that needs fixed or should be refactored!

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-03-08 17:32:34 +00:00
Frank Harkins 8492292da5 Add .gitattributes and guide for diffing objects.inv (#962)
This PR adds instructions on setting up Git to use
[`sphobjinv`](https://github.com/bskinn/sphobjinv) to display diffs for
`objects.inv`.

Since `objects.inv` is compressed, we can't review changes through `git
diff`. Git _does_ tell you if the file has changed, but this isn't that
helpful as the compressed file can be different even if the uncompressed
contents are the same.

Git will default back to binary diff if it doesn't find a rule in
`.gitconfig` so adding `.gitattributes` shouldn't disrupt contributors
that don't follow the guide.

Hopefully this information will help keep more eyes on the file and spot
any unintended changes.

Here's an example of it in action (downgrading qiskit to 0.46):
<img width="950" alt="Screenshot 2024-03-05 at 14 20 04"
src="https://github.com/Qiskit/documentation/assets/36071638/5aabaca4-d175-4871-84c5-e583069e0c1a">
2024-03-05 14:58:23 +00:00
abbycross 8b9050e14f remove trademark from Qiskit and update readme (#946) 2024-03-01 21:02:42 +00:00
Eric Arellano 36741c14e7 Document how to pull in new versions of preview (#944)
It's confusing when `./start` diverges from `docs.quantum.ibm.com`.

We now warn every time when running `./start`:

```
❯ ./start 
Warning: this may be using an outdated version of the app. Run `docker pull qiskit/documentation` to check for updates.
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
   ▲ Next.js 14.0.1
   - Local:        http://f9e8103d2cee:3000
   - Network:      http://172.17.0.2:3000

 ✓ Ready in 1377ms
[remoteRefresh] server is listening at port 5001
```

I debated always running `docker pull qiskit/documentation`
automatically, but I think it's too slow and annoying.
2024-03-01 19:02:05 +00:00
Eric Arellano b91049d822 Split internal and external link checker into separate programs (#916)
Closes https://github.com/Qiskit/documentation/issues/876.

This split brings several improvements:

1. Simpler internal link checker code.
2. The external link checker now deduplicates links across all files,
which avoids repeating requests.
3. The external link checker logs its progress every 20 links.
4. It's possible to check external links without checking internal
links.

We run the external link checker in our weekly cron job over all files,
other than translations and historical Qiskit versions. That change was
added in https://github.com/Qiskit/documentation/pull/913.
2024-02-28 19:57:29 +00:00
Eric Arellano 2c82c0dc6a Pages render check only runs on changed files (#913)
Closes https://github.com/Qiskit/documentation/issues/886. As explained
there, it's safe to only run this check on changed files because whether
a page renders is independent from all the other pages.

We use a weekly cron job, though, to check all pages. That reduces our
risk from things like the docs preview Docker image changing on us and
resulting in some pages now failing to render.

--

This PR also stops checking external links in API docs builds and
instead moves the check to the new weekly cron job. Relates to
https://github.com/Qiskit/documentation/issues/876.

Per https://github.com/Qiskit/documentation/pull/372, it's annoying to
check external links in CI because it can be flaky
(https://github.com/Qiskit/documentation/issues/823).
2024-02-28 12:42:34 +00:00
Frank Harkins 5c9c97b520 Replace Squeaky CI advice with custom advice (#897)
Closes https://github.com/Qiskit/documentation/issues/838.

Replaces the message in CI with correct instructions for our repository.
I've added a switch to remove the advice from the printed message, I
think this is the neatest net logic change:
33e24f8eb6.


<img width="600" alt="Screenshot 2024-02-27 at 17 20 42"
src="https://github.com/Qiskit/documentation/assets/36071638/dff70ada-2eca-4041-83fd-e0177bc52bca">

See https://github.com/frankharkins/documentation/pull/2 for the test
PR.

This doesn't display the message when running `tox -e lint`, but I think
it's unlikely a contributor would run that command locally without first
encountering it in CI.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-27 18:14:29 +00:00
Kaelyn Ferris 7badbc30db Reconfigure cspell to use dictionaries (#873)
Closes #827
2024-02-23 16:02:11 +00:00
Rebecca Dimock fb275c6936 Add illustration of Admonition types (#836)
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-19 18:22:16 +00:00
Frank Harkins e4ad04b315 Add notebook linting (#724)
Uses squeaky to lint notebooks.

While this has some minor benefits (removing empty cells etc.), it will
become much more useful when we switch notebook outputs to SVG.
2024-02-16 14:50:08 +00:00
Eric Arellano 435ae6cb7b Don't check metadata for API docs by default (#817)
Closes https://github.com/Qiskit/documentation/issues/793. 

This unblocks us starting to check API docs in
https://github.com/Qiskit/documentation/issues/66. It also speeds up the
workflow for non-API docs, which is valuable because non-API and API
docs have such different workflows.

I only added an `--apis` argument rather than e.g. `--current-apis` vs
`--historical-apis` because this check is fast enough to not need the
nuance.

---------

Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
2024-02-15 16:21:50 +00:00
abbycross f0b9fd0988 Proper trademarking of IBM and third-party names (#746)
Closes #726 

The first instance on a page of every trademarked name (whether IBM or
third-party) should be marked with the trademark symbol (except in
headings, where the code will not render as a symbol).

Outstanding questions: Where does the trademark symbol occur if the
following are the first instance on a page?:
(editing to add: preliminary guidance directs us as follows: )

- [ ] IBM Quantum&trade; systems
- [ ] Qiskit&reg; Runtime service
- [ ] Qiskit&reg; Runtime
- [ ] Qiskit IBM Provider (still unknown)
- [ ] Qiskit&reg; Patterns
- [ ] Qiskit&reg; Experiments
- [ ] Qiskit&reg; 1.0
- [ ] Qiskit&reg; Runtime IBM Client
- [ ] Qiskit&reg; Runtime IBM REST API
- [ ] IBM Quantum&trade; Network

References: 
https://www.ibm.com/brand/experience-guides/quantum/voice#usage
https://www.ibm.com/legal/copyright-trademark


### Progress

- [x] Migration guides
- [x] Start
- [x] Build
- [x] Transpile
- [x] Verify
- [x] Run
- [x] Support

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-12 20:14:49 +00:00
Arnau Casau dbf724a583 Extend the API generation script to generate dev versions (#779)
This PR adds support to generate dev versions for the API generation
script.

For the moment, the automatic regeneration will not take into account
dev versions to keep this PR easy to review. I'll add support for that
in a follow-up, together with the documentation of the dev versions.

Part of #316

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-08 16:38:23 +00:00
Arnau Casau de4fdcde9e Automate the regeneration of the API docs (#739)
### Summary
Thanks to #737, the API generation script doesn't need an argument to
specify the CI artifact URL used in the generation. Because of that, we
can automatize the script to regenerate all API docs in the repository.

### New command
The PR adds a new command `regen-apis` where we can regenerate multiple
versions of our three APIs with one command:
```bash
npm run regen-apis
```

By default, all minor releases of each API will be regenerated, but we
can add the `--current-apis-only` argument to regenerate only the latest
stable versions.

```bash
npm run regen-apis -- --current-apis-only
```

Alternatively, you can regenerate only one of the three available APIs.
We can use the `-p` argument, which could be combined with the other
arguments, similarly to the API generation script:

```bash
npm run regen-apis -- -p <pkg-name>
```

### Git instructions
To run the script, we need to create a dedicated branch and have a clean
git status. The script will create a commit per version regenerated and
the developers can git cherry-pick them how they want to create
different PRs.

If the regeneration fails for a specific version, the script will call
`git restore` to avoid mixing changes from two different versions when
regenerating the next one.

### Output
At the end of each call to the new command, we will see a summarization
of all versions regenerated with three different possible outcomes per
version:

<table style="width:100%">
  <tr>
    <th>Possible Output</th>
    <th>Meaning</th>
    <th>Creates a new commit</th>
    <th>Restores the files</th>
  </tr>
  <tr>
    <td> <pkg-name> <version> regenerated correctly</td>
    <td>The regeneration was successful</td>
    <td>Yes</td>
    <td>No</td>
  </tr>
  <tr>
    <td>☑️ <pkg-name> <version> is up-to-date</td>
    <td>The regeneration was successful, but no files were modified</td>
    <td>No</td>
    <td>No</td>
  </tr>
  <tr>
    <td> <pkg-name> <version> failed to regenerate</td>
   <td>The regeneration failed</td>
   <td>No</td>
   <td>Yes</td>
 </tr>
</table>
                 
      

Closes #720

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-02 13:19:20 +00:00
Frank Harkins fe7db80030 Tweak API generation guide (#742)
Very minor corrections I found while following the guide.
2024-02-01 17:22:23 +00:00
Arnau Casau 0b03f95d58 API generation script uses Box to download CI artifacts (#737)
Part of #719

This PR modifies the API generation script to download the CI artifacts
stored in the Box folder https://ibm.ent.box.com/folder/246867649571 and
removes the `-a <artifact-url>` argument.

The PR also renames the old `scripts/lib/api/downloadCIArtifacts.ts` to
`scripts/lib/api/apiArtifacts.ts` to make it more generic, and it
removes the associated test. The test file only was related to the `-a`
argument that was removed.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-01 14:57:33 +00:00
Eric Arellano 32a63d1ad2 Fix setting class name for videos (#648)
Even though this looks like an HTML element, it's rendered by React so
apparently needs to be called `className`.
2024-01-19 15:17:05 +00:00
Eric Arellano 80aa112649 Add support for videos (#633)
Turns out videos have always been supported! But we needed to:

1. Change our Docker images to load `public/videos`
2. Teach our link checker about videos
3. Document how to use them in the README

This unblocks https://github.com/Qiskit/documentation/pull/622. Example
of that PR with this one applied:

<img width="857" alt="Screenshot 2024-01-16 at 1 40 27 PM"
src="https://github.com/Qiskit/documentation/assets/14852634/779c0257-92aa-4814-bb67-3b594a98704b">
2024-01-17 17:13:37 +00:00
Eric Arellano e6c7f8416d Add check that all pages render (#572)
Closes https://github.com/Qiskit/documentation/issues/511. Example:

```
$ npm run check-pages-render

Checked 10 / 71 pages
Checked 20 / 71 pages
Checked 30 / 71 pages
Checked 40 / 71 pages
Checked 50 / 71 pages
Checked 60 / 71 pages
Checked 70 / 71 pages
 All pages render without crashing
```

## Only checks non-API docs by default

This script is quite slow, at least on my M1 because the Docker images
is built with x86.

So, to avoid CI slowing down too much, we only check non-API pages in PR
builds. Our nightly cron job checks everything else.

## Does not auto-start Docker

We no longer have the file `webServer.ts` thanks to
https://github.com/Qiskit/documentation/pull/578, which was a great
improvement.

Rather than adding back somewhat complex code for us to auto-start the
server—and then to periodically ping if it's ready or time out—we expect
the user to start up the server. That's acceptable since usually people
will rely on CI to run this check. It's too slow for people to be
frequently running locally.

---------

Co-authored-by: Frank Harkins <frankharkins@hotmail.co.uk>
2024-01-05 18:46:27 +00:00
Eric Arellano 5a230d9e60 Check Runtime historical API docs for broken links (#569)
Part of https://github.com/Qiskit/documentation/issues/495. We now will
enforce in CI that historical API docs are valid for Runtime and
Provider. To do this, this PR adds the `--skip-broken-historical`
argument.

In a follow up, I want to try checking Qiskit docs, at least certain
versions. But I'm waiting until we regenerate the docs with
https://github.com/Qiskit/documentation/pull/552 applied because I
suspect it will fix some issues.
2024-01-05 13:44:01 +00:00
Frank Harkins 61e783de49 Upload notebooks in CI (#527)
Closes #523.

See https://github.com/Qiskit/documentation/actions/runs/7225258563 for
an example of this working.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-01-03 21:10:39 +00:00
Eric Arellano cd2c573021 Allow checking historical APIs with link checker (#560)
This unblocks https://github.com/Qiskit/documentation/issues/495. We
still have to actually fix the broken links, but we can at least now
detect them.

To make the script more interactive, we now output a description of each
file batch, like this:

```
Checking links for non-API docs


Checking links for qiskit-ibm-runtime v0.14
 docs/api/qiskit-ibm-runtime/0.14/ibm-runtime.md: Could not find link 'runtime_service'  Did you mean '/api/qiskit-ibm-runtime/0.14/ibm-runtime'?
 docs/api/qiskit-ibm-runtime/0.14/qiskit_ibm_runtime.QiskitRuntimeService.md: Could not find link '/api/qiskit/providers_models'


Checking links for qiskit-ibm-runtime v0.15
 docs/api/qiskit-ibm-runtime/0.15/ibm-runtime.md: Could not find link 'runtime_service'  Did you mean '/api/qiskit-ibm-runtime/0.15/ibm-runtime'?
 docs/api/qiskit-ibm-runtime/0.15/qiskit_ibm_runtime.QiskitRuntimeService.md: Could not find link '/api/qiskit/providers_models'
```

Note that to fix the broken links, we're going to need to set `toLoad`
for some of the projects. For example, you can see in the above
`qiskit-ibm-runtime` failures that they need to read in the file
`/api/qiskit/providers_models`. I plan to address that in a follow up
because we want to load the minimum amount of files possible to reduce
memory usage, so I still want to see what we really need to load.

---------

Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
2023-12-29 17:53:49 +00:00
Eric Arellano 3b2b7e6a97 Check links for release notes (#559)
Part of https://github.com/Qiskit/documentation/issues/495. 

--

This PR adds two arguments to `npm run check:links`, `--current-apis`
and `--qiskit-release-notes`. In a follow up, we'll add
`--historical-apis`. By default, we don't do any of these checks since
it's pretty rare for a PR author to be changing those files and we want
`npm run check` to be as fast as possible locally. CI will still check
the whole thing, though.

This makes the script around 2x faster:

```
npm run check:links  4.04s user 0.32s system 156% cpu 2.797 total
npm run check:links -- --current-apis --qiskit-release-notes  8.66s user 0.99s system 134% cpu 7.182 total
```

--

To fix the actual broken links, I manually fixed problems in release
notes up to 0.44. We are unlikely to regenerate these release notes, so
manual fixes should be fine.

I did not fix 0.45, though, since we will continue to regenerate those
release notes per https://github.com/Qiskit/documentation/pull/537. We
will need to fix the underlying problem in the API docs, or in our API
generation script.
2023-12-29 15:59:20 +00:00
Eric Arellano 3d7a8fb747 Add Crowdin to set up translations (#541)
Part of  https://github.com/Qiskit/documentation/issues/476. 

This PR sets up two GitHub actions for interfacing with Crowdin.com, the
website the translation team uses for translations.

1. Upload English sources. We do this on any change to `docs/` (except
API docs), which the translation team so that they can start making
updates sooner. For example:

<img width="346" alt="Screenshot 2023-12-20 at 5 45 05 PM"
src="https://github.com/Qiskit/documentation/assets/14852634/0ed4cbed-45db-45bb-9150-5d90bec7a0f6">

2. Download the translations. This happens once a week, which the
translations team requested. It will open up a pull request like
https://github.com/Eric-Arellano/documentation/pull/10.

## How auth works

We only need to set GitHub Secrets for CROWDIN_PROJECT_ID and
CROWDIN_PERSONAL_TOKEN. GitHub will automatically set GITHUB_TOKEN using
[this
mechanism](https://docs.github.com/en/actions/security-guides/automatic-token-authentication).

## Translations saved at `translations/` folder

This adds a top-level `translations/` folder, rather than nesting the
translations inside the `docs/` folder. For example:

<img width="367" alt="Screenshot 2023-12-20 at 5 48 09 PM"
src="https://github.com/Qiskit/documentation/assets/14852634/42e27fd4-5c67-4ceb-aae3-8f25315f7aae">

This top-level folder is useful because it reduces noise in the `docs/`
folder. It makes it more obvious to the team what is the original source
docs vs. what is translations and should not be modified directly in
this repository.

### How this works with the app

To get docs previews working in this repo, we teach the Docker image to
mount `translations/` as if its contents were in the folder `docs/`,
since the application expects all content to live there.

When we sync the translations from open-source to closed-source for
production, we will copy the contents of `translations/` so that it
actually lives underneath `docs/`. For example,
`translations/es/support.mdx` becomes `docs/es/support.mdx`.

## Locales

As explained in https://github.com/Qiskit/documentation/issues/7, we
generally want to use the two-letter code for languages, like `es` and
`fr`. The only exception is Chinese, where we need to distinguish
between Traditional and Simplified.

This config works with that, so long as in Crowdin.com, the project sets
up this Language Mapping under the Languages settings:

<img width="475" alt="Screenshot 2023-12-20 at 5 59 19 PM"
src="https://github.com/Qiskit/documentation/assets/14852634/adf643d1-716a-435c-9e32-9762c6570956">

## Doesn't yet add `_languages.json`

As explained in https://github.com/Qiskit/documentation/issues/7, we
will probably want a file like `_languages.json` that teaches the docs
app what each language is, such as its name to show in the language
toggle. That schema still needs to be finalized and it can be added in a
follow up.
2023-12-29 15:45:56 +00:00
Frank Harkins b5d1307449 Test notebooks on pull request (#483)
Adds a GitHub action to test notebook code examples on pull request.

### Handling notebooks that submit jobs

We only want to submit jobs to IBM Quantum _very_ rarely (such as
updating notebook outputs once per qiskit release), but runtime doesn't
have a way of restricting the types of job you can send.

In this PR, I've limited cell execution to 100s. This should be short
enough to do most local tasks and to get backend information, but not
nearly long enough for a job to run on the open provider (usually takes
hours).

If someone accidentally makes a PR with a notebook that submits jobs,
the script will timeout and raise an error. On exit, the script cancels
any jobs created since it started running. This means they won't take up
any resources, and the author will be alerted when CI fails.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
2023-12-14 14:58:47 +00:00
Eric Arellano 8313543fc7 Add a Markdown guide (#520)
Closes https://github.com/Qiskit/documentation/issues/367.

@axelhzf had written an excellent guide for how to work with MDX in the
closed source repository, but it wasn't copied over here when docs moved
to open source.

This PR:

* Copies over Axel's guide with some small tweaks
* Adds guidance on adding a new page, including how to choose between
MDX vs. Jupyter and how to name the file
* Mentions collapsible sections

---------

Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Co-authored-by: abbycross <across@us.ibm.com>
2023-12-13 21:42:06 +00:00
Arnau Casau c53f7cec2a API generation from CI artifacts (#492)
Closes #311.

It adds a new method to generate the API docs using a CI artifact. The
script has a new mandatory argument `--artifact` or `-a` to specify a
link to a specific artifact we want to download. This change is
necessary because we can't use qiskit.org anymore.

To be able to download the artifacts, we need to have installed and
configured the [GitHub command
line](https://docs.github.com/en/github-cli/github-cli/quickstart).

Example of a generation for the Qiskit 0.45 API docs using an artifact:

`npm run gen-api -- -p qiskit -v 0.45.0 -a
https://github.com/Qiskit/qiskit/suites/17881600359/artifacts/1026798160`
2023-12-08 12:23:20 +00:00
Frank Harkins 8ef53a0a9c Add code to test notebook code examples (#471)
This PR adds a script to automatically execute notebooks in CI.

To keep PRs small and focussed, this only adds the scripts to test
notebooks, it doesn't actually fix those notebooks or add anything to
CI.

<details>
  <summary>Example: Success</summary>

![Screenshot 2023-12-04 at 14 22
15](https://github.com/Qiskit/documentation/assets/36071638/2c6f698d-f990-456c-b20d-241db4d0007c)

</details>

<details>
  <summary>Example: Failure</summary>

![Screenshot 2023-12-04 at 14 23
17](https://github.com/Qiskit/documentation/assets/36071638/4983fcae-6d32-4c26-bdb3-4d6035d0a2fa)

</details>

<details>
  <summary>Why <code>tox</code>?</summary>

An important feature is to be able to run a single notebook in the
virtual environment. With `tox`, we can use commands like this:

```sh
tox -- path/to/notebook
```

Whereas with `nox`, this is the simplest I could get it:

```sh
nox --session 'test(path="path/to/notebook")'
```

Note this also doesn't autocomplete the path.

The main reason for choosing `nox` seems to be more flexible
configuration, but we only need simple configuration in this repo so
this isn't a problem.

</details>

***

Part of #166

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2023-12-05 16:05:44 +00:00
kristian koci 6a186323e2 Update quantum-computing.ibm.com to quantum.ibm.com (#453)
Please, have a look whenever possible. @Eric-Arellano 

All occurrences where quantum-computing.ibm.com have been changed to
quantum.ibm.com , leaving subdomains untouched.

EDIT:

I did git pull upstream before creating this branch, now I see there are
some conflicts, maybe there was a merge while I was creating this PR?
2023-12-02 23:18:40 +00:00
Arnau Casau c10e203220 Converting current API to historical (#405)
We need a method to convert the current API into a historical version,
and for this purpose, we can use the new `convertApiDocsToHistorical.ts`
script using the `make-historical` new command. This command expects an
argument specifying the name of the API we want to switch over. For
example:

> npm run make-historical -- -p qiskit

This feature is useful for `qiskit-ibm-runtime` and `qiskit-ibm-povider`
since they don't publish more than one documentation version.

Moreover, using this new tool, this PR adds back version 0.14 of
qiskit-ibm-runtime into a subfolder in the project.

Closes #332
2023-11-28 17:25:09 +00:00
Abby Mitchell 91cdd2e3e2 Audited qiskit.org links (#381)
This PR replaces any qiskit.org links with 1XP or github equivalents.
Need to wait to merge until I can update the deprecation policy and
maintainer guide links after
https://github.com/Qiskit/qiskit/pull/11218/ merges.

This should partially resolve #297 , however for the api links we'll
need to make updates for those directly in the repos where the API refs
live (maybe this is beyond the scope of the original issue?)

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2023-11-22 15:52:57 +00:00
Eric Arellano 69d81a4c3b Allow generating historical API versions (#377)
First part of https://github.com/Qiskit/documentation/issues/332. A
follow up will generate historical versions prior to Qiskit 0.44; this
PR is focused on the general infrastructure.

See https://github.com/Qiskit/documentation/issues/8 for the overall of
the folder structure.

Users can now run `npm run gen-api -- -p qiskit -v 0.44.0 --historical`.

Runtime and Provider aren't supported since they need
https://github.com/Qiskit/documentation/issues/332.

## How links work

We still use relative links for API cross-references. That works because
the links will be relative to the current directory, whether that is
`0.44/` or the unversioned top-level folder.

However, images use absolute links. We decided to have dedicated folders
for images for each API, rather than sharing a common folder. That is
because images may change throughout API versions and we don't want to
risk merge conflicts.

## Release notes

Per https://github.com/Qiskit/documentation/issues/330, every API
version should have identical release notes. We decided that's desirable
UI.

So, this PR copies the top-level release notes when adding a new
historical version. That implements the first part of #330; now we only
need a script that validates the release notes are all in sync, and also
a way to have updates to the top-level release notes automatically
update the subfolders.

---------

Co-authored-by: Arnau Casau <47946624+arnaucasau@users.noreply.github.com>
Co-authored-by: Arnau Casau <arnaucasau@gmail.com>
2023-11-22 15:02:26 +00:00
Arnau Casau fc71c2d9ed Link checker: skip folders, validation of release notes & new CI tests (#372)
Closes #368. 

It adds the following features:

- A method to skip complete folders using glob patterns.
- A daily cron job to validate all the internal and external links.
- Validation of the release notes by default

The CI test has been changed to validate only internal links. The
motivation behind this is we want the CI to be fast, and also, the
validation of external links can make it fail due to fetch errors for
external reasons that have nothing to do with the correctness of the
link. Regardless, we still want to validate external links, and a new
daily test has been added to check all the external links.
2023-11-20 17:40:21 +01:00
Eric Arellano bb4fa30b29 Fix index pages for Runtime and Provider API docs (#355)
Closes https://github.com/Qiskit/documentation/issues/339.

It wasn't intentional that we didn't have `index.md` files and instead
used `/runtime_service` and `/ibm_provider`. It was only because that's
what the original qiskit.org docs do, and I don't think we realized that
was bad and we should fix it.

This PR does mean `/runtime_service` and `/ibm_provider` will now 404. I
couldn't find any references to those pages outside of our own docs, so
it didn't seem necessary to set up redirects. But I can if we think it's
important.
2023-11-15 10:31:18 -05:00