Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't delete API docs for class aliases #815

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

Eric-Arellano
Copy link
Collaborator

Part of #814. We shouldn't be deleting attribute pages if they don't correspond to an owning class.

This PR also runs npm run regen-apis; as shown, this PR's logic change only impacts Qiskit v1 docs.

Copy link
Member

@frankharkins frankharkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated output looks good!

I have a couple of non-blocking questions.

Comment on lines +38 to +44
const unsortedMembers = resultsWithName.filter(
(result) =>
includes(["method", "property", "attribute"], result.meta.apiType) &&
result.meta.apiName?.startsWith(`${clazz.meta.apiName}.`),
);
unsortedMembers.forEach((result) => mergedMemberUrls.add(result.url));
const members = orderBy(unsortedMembers, (result) => result.meta.apiName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice code, I find this new form a lot easier to read.

To check I understand: The logic change is we're no longer adding function API types to members, and we're keeping track of which members have been merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. I don't know why we were looking for functions before - they never are members of a class. In practice, it made no difference if we included them or not.

Comment on lines -97 to -100
// remove merged results
const finalResults = reject(results, (result) =>
includes(["method", "attribute", "property"], result.meta.apiType),
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the pages were being deleted because we were assuming certain apiTypes were merged. Now we just check if they're in mergedMemberUrls.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly.

@Eric-Arellano Eric-Arellano added this pull request to the merge queue Feb 15, 2024
Merged via the queue into main with commit be59189 Feb 15, 2024
6 checks passed
@Eric-Arellano Eric-Arellano deleted the EA/dont-rm-alias-attribute branch February 15, 2024 12:29
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
Part of Qiskit#814. We shouldn't
be deleting attribute pages if they don't correspond to an owning class.

This PR also runs `npm run regen-apis`; as shown, this PR's logic change
only impacts Qiskit v1 docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants