Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-97908: CAPI docs: Remove repeated struct names from member docs#100054

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 7 commits intopython:mainfromencukou:struct-name-repeats
May 29, 2023

Conversation

encukou
Copy link
Member

@encukouencukou commentedDec 6, 2022
edited
Loading

Members with repeated struct names were interpreted as e.g.PyType_Spec.PyType_Spec.name,
showing up incorrectly wrong in the search and index, and complicating automation.

This removes the duplicated names, but keeps old HTML anchors so that external links continue to work.
I don't see a better way than raw HTML to add custom anchors with dots.

MostPyMemberDef fields were already fixed inGH-99014,old anchors are added for those too.

Edit:PyMemberDef andPyGetSetDef were only marked up in 3.12 (gh-97909), so they don't need “old” URL anchors.

@encukou
Copy link
MemberAuthor

(I've included and reverted a hack to find these. I don't think it's worth keeping, at least without better error reporting. Eventually I hope we'll grow general checks that docs correspond to code.)

@netlify
Copy link

netlifybot commentedDec 6, 2022
edited
Loading

Deploy Preview forpython-cpython-preview ready!

NameLink
🔨 Latest commitcc57955
🔍 Latest deploy loghttps://app.netlify.com/sites/python-cpython-preview/deploys/638f6c9df0890f000965d292
😎 Deploy Previewhttps://deploy-preview-100054--python-cpython-preview.netlify.app/c-api/structures
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site settings.

These were only marked up in 3.12 (pythongh-97909), so they don't needbackcompat backflips.
@CAM-Gerlach
Copy link
Member

CAM-Gerlach commentedDec 7, 2022
edited
Loading

I don't see a better way than raw HTML to add custom anchors with dots.

I can think of a few practical solutions here that should work, that would be cross-builder, less hacky, and more concise, clean and precise, andshould be able to fix internal and intersphinx references as well:

  • Add a custom directive.. literal-target:: or similar that could be used anywhere to add a literal explicit target (without normalizing the label); this would be the most general solution, but users would have to specify the fully qualified raw label name (as you do here)
  • Add a custom directive.. alias:: or similar that could be used as a child of any domain directive (like.. c:member::), that would list alias(es) of that domain directive. A little less general, but simpler for users to use, as they only have to specifiy the immediate alias name
  • As a the most specific solution to this problem, but potentially requiring the least work by users, in our custom extension (that you inserted the check into), we could potentially add some custom code to fix the issue and retain the existing cross-references as well as new fixed ones.

I have some meetings now, but I'll explore these further and report back later tonight

@encukou
Copy link
MemberAuthor

Sounds good! But it also sounds like it could use a longer discussion, since there's no obvious better way :(

Unless there's aproblem withraw, let's use it for now, and file an issue for the improvement? I'd like to unblock#96996 which will also need to retain anchors.

@CAM-Gerlach
Copy link
Member

Yeah, I guess that makes the most sense, unless@AA-Turner has a better solution—I intended to get to it yesterday, but I've been busy since then helping students with their Python final projects, so I haven't had the chance to continue to dig into it and prototype something.

@encukouencukou added the needs backport to 3.12only security fixes labelMay 25, 2023
@encukouencukou merged commit1668b41 intopython:mainMay 29, 2023
@miss-islington
Copy link
Contributor

Thanks@encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@encukouencukou deleted the struct-name-repeats branchMay 29, 2023 11:54
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 29, 2023
…ocs (pythonGH-100054)And add raw HTML fragments to keep old links working.(cherry picked from commit1668b41)Co-authored-by: Petr Viktorin <encukou@gmail.com>
@bedevere-bot
Copy link

GH-105057 is a backport of this pull request to the3.12 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.12only security fixes labelMay 29, 2023
ambv pushed a commit that referenced this pull requestJun 5, 2023
…docs (GH-100054) (#105057)And add raw HTML fragments to keep old links working.(cherry picked from commit1668b41)Co-authored-by: Petr Viktorin <encukou@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AA-TurnerAA-TurnerAwaiting requested review from AA-Turner

Assignees
No one assigned
Labels
docsDocumentation in the Doc dirskip news
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@encukou@CAM-Gerlach@miss-islington@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp