forked from Qiskit/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop using a web server for the API docs generation (Qiskit#578)
### Summary This PR is part of Qiskit#564 and changes the `updateApiDocs.ts` script to stop using a web server and a web crawler for the API docs generation. Instead, the script uses the HTML in the artifact zip file to convert it into markdown and copies the images from the same zip to the respective version folder without downloading it from any web server. ### Details #### Convert HTML to markdown After removing the web crawler used to download the HTML files that the script translated into markdown, we need to take into account HTML files that are used as a redirect, like `stubs/qiskit.utils.name_args.html` for Qiskit v0.45: ```html <html><head><meta http-equiv="refresh" content="0; url=https://qiskit.org/documentation/apidoc/utils.html#qiskit.utils.name_args"></head></html> ``` These files were not downloaded using the web crawler and therefore, not processed by the `sphinxHtmlToMarkdown` function. Now, the script will try to convert those files into markdown as well, ending up in an empty markdown file we need to remove. That is translated into this conditional in `updateApisDocs.ts`: ```ts if (result.markdown == "") { continue; } ``` #### Save images As for the images, we don't need the web server because we can find them in the folder called `_images` inside the artifact zip file. The script will copy all the images to the correct API version images folder. Moreover, the script only saves the images corresponding to the release notes for the current APIs (not using the historical argument). This change will allow us to remove unnecessary duplicate images we are currently downloading. #### Bug fix In addition to that change, the PR fixes an underlying issue with the old method. We were only downloading images when they were not present in the API images folder by checking if we already had a file with the same name. New versions of the same API have new images with the same name as the old ones, and because of that, we were never saving the new ones. All the historical versions will be regenerated in a follow-up. Commands used: ```bash npm run gen-api -- -p qiskit -v 0.45.0 -a https://github.com/Qiskit/qiskit/actions/runs/6744953436/artifacts/1026798160 npm run gen-api -- -p qiskit-ibm-provider -v 0.7.3 -a https://github.com/Qiskit/qiskit-ibm-provider/actions/runs/7301486985/artifacts/1131430696 npm run gen-api -- -p qiskit-ibm-runtime -v 0.17.0 -a https://github.com/Qiskit/qiskit-ibm-runtime/suites/18863019852/artifacts/1100724937 ``` Closes Qiskit#564 --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
- Loading branch information
1 parent
26acc62
commit ba9f3de
Showing
142 changed files
with
63 additions
and
320 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-8.07 KB
(88%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_0_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.35 KB
(190%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_10_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.65 KB
(72%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_11_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-28 Bytes
(100%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_12_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+711 Bytes
(110%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_13_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12.8 KB
(350%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_14_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+449 Bytes
(100%)
...i/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_15_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-29.9 KB
(68%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+14 Bytes
(100%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_2_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+109 Bytes
(100%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_3_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+8.68 KB
(170%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_4_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+7.17 KB
(290%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_5_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-3.88 KB
(66%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_6_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+577 Bytes
(110%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_7_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.77 KB
(160%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_8_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.24 KB
(80%)
...pi/qiskit-ibm-provider/qiskit_ibm_provider.transpiler.passes.scheduling_9_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+268 Bytes
(100%)
public/images/api/qiskit/providers_fake_provider-1_02.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-ControlledGate-1.png
Oops, something went wrong.
Binary file modified
BIN
+42 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-ControlledGate-2.png
Oops, something went wrong.
Binary file modified
BIN
+260 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-InstructionSet-1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+1 Byte
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-1.png
Oops, something went wrong.
Binary file modified
BIN
-4 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-3_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-3_01.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-4_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-4_01.png
Oops, something went wrong.
Binary file modified
BIN
-26 Bytes
(99%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-5.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-QuantumCircuit-6.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
-207 Bytes
(98%)
public/images/api/qiskit/qiskit-circuit-library-FourierChecking-1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+2 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-GraphState-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-HiddenLinearFunction-1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+61 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-InnerProduct-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-MCMTVChain-1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-PauliTwoDesign-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-Permutation-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-Permutation-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-PermutationGate-1.png
Oops, something went wrong.
Binary file modified
BIN
+207 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-PermutationGate-2.png
Oops, something went wrong.
Binary file modified
BIN
+34 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-PhaseEstimation-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-PiecewiseChebyshev-1.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-circuit-library-QuantumVolume-1.png
Oops, something went wrong.
Binary file modified
BIN
-143 Bytes
(99%)
public/images/api/qiskit/qiskit-circuit-library-QuantumVolume-2.png
Oops, something went wrong.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-pulse-library-SymbolicPulse-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-quantum_info-Statevector-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-transpiler-passes-DynamicalDecoupling-1_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-transpiler-passes-DynamicalDecoupling-1_01.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-transpiler-passes-PadDynamicalDecoupling-1_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-transpiler-passes-PadDynamicalDecoupling-1_01.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-transpiler-passes-RemoveBarriers-1.png
Oops, something went wrong.
Binary file modified
BIN
-5 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-circuit_drawer-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_bloch_multivector-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_bloch_multivector-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_bloch_vector-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_bloch_vector-2.png
Oops, something went wrong.
Binary file modified
BIN
+844 Bytes
(110%)
public/images/api/qiskit/qiskit-visualization-plot_circuit_layout-1.png
Oops, something went wrong.
Binary file modified
BIN
-299 Bytes
(96%)
public/images/api/qiskit/qiskit-visualization-plot_coupling_map-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_distribution-1_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_distribution-1_01.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_distribution-1_02.png
Oops, something went wrong.
Binary file modified
BIN
+1.54 KB
(100%)
public/images/api/qiskit/qiskit-visualization-plot_error_map-1.png
Oops, something went wrong.
Binary file modified
BIN
+1.07 KB
(120%)
public/images/api/qiskit/qiskit-visualization-plot_gate_map-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_histogram-1_00.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_histogram-1_01.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_histogram-1_02.png
Oops, something went wrong.
Binary file modified
BIN
+37.1 KB
(150%)
public/images/api/qiskit/qiskit-visualization-plot_state_city-1.png
Oops, something went wrong.
Binary file modified
BIN
+49 KB
(150%)
public/images/api/qiskit/qiskit-visualization-plot_state_city-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_state_hinton-1.png
Oops, something went wrong.
Binary file modified
BIN
-546 Bytes
(97%)
public/images/api/qiskit/qiskit-visualization-plot_state_paulivec-1.png
Oops, something went wrong.
Binary file modified
BIN
-97 Bytes
(99%)
public/images/api/qiskit/qiskit-visualization-plot_state_paulivec-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_state_qsphere-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-plot_state_qsphere-2.png
Oops, something went wrong.
Binary file modified
BIN
+418 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-pulse_drawer-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-pulse_drawer-2.png
Oops, something went wrong.
Binary file modified
BIN
+128 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-pulse_drawer-3.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-timeline_drawer-1.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-timeline_drawer-2.png
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
public/images/api/qiskit/qiskit-visualization-timeline_drawer-3.png
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.