Skip to content

Commit

Permalink
Add objects.inv for historical API docs (#850)
Browse files Browse the repository at this point in the history
Closes #829.
  • Loading branch information
Eric-Arellano authored Feb 20, 2024
1 parent f504384 commit 0a20b8d
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 9 deletions.
Binary file added public/api/qiskit-ibm-provider/0.7/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-provider/0.8/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-runtime/0.14/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-runtime/0.15/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-runtime/0.16/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-runtime/0.17/objects.inv
Binary file not shown.
Binary file added public/api/qiskit-ibm-runtime/0.18/objects.inv
Binary file not shown.
Binary file added public/api/qiskit/0.45/objects.inv
Binary file not shown.
Binary file added public/api/qiskit/0.46/objects.inv
Binary file not shown.
9 changes: 9 additions & 0 deletions scripts/commands/convertApiDocsToHistorical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ zxMain(async () => {
projectNewHistoricalFolder,
);
await copyImages(pkgName, versionWithoutPatch);
await copyObjectsInv(pkgName, versionWithoutPatch);
});

async function copyApiDocsAndUpdateLinks(
Expand Down Expand Up @@ -143,6 +144,14 @@ async function copyImages(pkgName: string, versionWithoutPatch: string) {
await $`find ${imageDirSource}/* -maxdepth 0 -type f | grep -v "release_notes" | xargs -I {} cp -a {} ${imageDirDest}`;
}

async function copyObjectsInv(pkgName: string, versionWithoutPatch: string) {
console.log("Copying objects.inv");
const sourceDir = `${getRoot()}/public/api/${pkgName}`;
const destDir = `${getRoot()}/public/api/${pkgName}/${versionWithoutPatch}`;
await mkdirp(destDir);
await $`cp -a ${sourceDir}/objects.inv ${destDir}`;
}

async function updateLinksFile(
pkgName: string,
versionWithoutPatch: string,
Expand Down
10 changes: 1 addition & 9 deletions scripts/lib/api/Pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,7 @@ export class Pkg {
}

hasObjectsInv(): boolean {
// We don't currently worry about objects.inv for historical API docs because we don't
// expect users to care about it, so we can keep things simple. For example, our copy
// of the historical Qiskit API docs <0.32 did not include `objects.inv`, so we could
// never get the mechanism working for those.
//
// Feel free to enable this mechanism for historical API docs if users find it useful!
// When adding, be sure that we correctly point to the correct subfolder, e.g.
// api/qiskit/0.44 rather than api/qiskit.
return !this.isHistorical();
return this.name !== "qiskit" || +this.versionWithoutPatch >= 0.45;
}

/**
Expand Down

0 comments on commit 0a20b8d

Please sign in to comment.