This PR adds the `/docs/` base path to all API docs links by modifying
the MDX conversion pipeline. It also updates all the ignores to include
the base path.
I recommend reviewing the first 5 commits separately as they implement
all the code changes. The rest of the commits have been generated by
running `npm run regen-apis`
To update the qiskit release notes I used the following script:
<details><summary>Script</summary>
```ts
import { globby } from "globby";
import { readFile, writeFile } from "fs/promises";
export async function updateBrokenLinks(filePath: string): Promise<void> {
let markdown = (await readFile(filePath)).toString();
var regex = new RegExp(`\\]\\(\\/((?!docs\\/)[^\\)]*)\\)`, "g");
markdown = markdown.replaceAll(regex, `\]\(/docs/$1\)`);
await writeFile(filePath, markdown);
}
async function main() {
const globs = [
"docs/api/qiskit/release-notes/**/*.{ipynb,mdx}",
];
const allGuides = await globby(globs);
for (const guide of allGuides) {
await updateBrokenLinks(guide);
}
}
main().then(() => process.exit());
```
</details>
The PR workarounds some checks in order to get green CI. All of the
checks will be updated to take into account the base path in
https://github.com/Qiskit/documentation/pull/2958