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.
Split
processMembersAndSetMeta
function into helper functions (Qisk…
…it#954) ## Summary This PR splits the `processMembersAndSetMeta` function from the `processHtml.ts` script into several helper functions to process each `apiType`. ## Changes These changes are done to the `map()` used to create the `replacement` variable (line 291). The map used to have all the logic to process each child depending on its `apiType`. Now the map starts by early returning in the case we are not processing a `<dt>` tag and calling to a new helper function to process an individual child. Before the `map()` was setting the metadata, the refactor moved the code outside of it, given that the metadata doesn't depend on the elements iterated. The new helper function is called `processMember` and starts by preparing the GitHub source link, removing the `apiType` from the `em.property` selector, and calling other new helper functions to process each of our available `apiType`. All the process `apiType` functions have the same code as before but `processAttribute`, which has been refactored to find the name, type, and default value of an attribute in a more concise way
- Loading branch information
1 parent
8a2e97c
commit a09d4bf
Showing
1 changed file
with
158 additions
and
100 deletions.
There are no files selected for viewing
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