qiskit-documentation/docs/api/qiskit-addon-aqc-tensor
Arnau Casau f09e7fb055
Add `/docs/` base path to all API docs links (#2973)
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
2025-04-17 14:59:41 +00:00
..
0.1 Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
_package.json Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
_toc.json Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation-ansatz-block.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation-kak.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation-one-qubit-ansatz-block.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation-two-qubit-ansatz-block.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation-zxz.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
ansatz-generation.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
index.mdx
objective.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
release-notes.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-aer-qiskit-aer-mps.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-aer-qiskit-aer-simulation-settings.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-aer.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-quimb-qiskit-quimb-conversion-context.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-quimb-quimb-circuit-factory.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-quimb-quimb-simulator.mdx Generate qiskit-addon-aqc-tensor 0.2 (#2878) 2025-03-28 19:17:30 +00:00
simulation-quimb.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00
simulation.mdx Add `/docs/` base path to all API docs links (#2973) 2025-04-17 14:59:41 +00:00