Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix API generation inlining methods mechanism (#619)
This PR fixes a problem we have when regenerating the API docs with pages that already have the methods inlined. The `mergeClassMembers.ts` script replaces all the content under the methods and attributes sections for the inlined members, but if there are none, the sections end up empty. For example, in Qiskit v0.26, we can see how files, like `docs/api/qiskit/0.26/qiskit.extensions.HamiltonianGate.md`, have the methods and attributes sections with a table of contents of all its elements, and after the sections, we find all methods/attributes mixed up and ordered alphabetically. The result of applying the script to files like that one was to have the methods and attributes sections empty, and the actual members listed below without any change. ```md ## Methods ## Attributes {all methods and attributes alphabetically sorted} ``` This PR adds an if condition to check when we have new methods/attributes to inline and when we need to keep the old content, like the table of contents mentioned before. It also adds a new test to verify that situation.
- Loading branch information