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

Fix "can't link function short name if it matches module name" #245

Merged
merged 2 commits into from
May 7, 2024

Conversation

rdzman
Copy link
Contributor

@rdzman rdzman commented Mar 12, 2024

Please see if you think this is the correct fix for #243. I didn't get a chance to create a test specifically for this issue, but all of the existing tests pass, and it does fix the particular case I encountered.

And let me know if you need me to create a test before you merge this.

@rdzman rdzman changed the title Fix "can't link function short name if it matches module name" #243. Fix "can't link function short name if it matches module name" Mar 12, 2024
@rdzman
Copy link
Contributor Author

rdzman commented Mar 21, 2024

Please see this comment.

Is there a downside to deleting all of ...

if self.env.config.matlab_short_links:
# modname is only used for package names
# - "target.+package" => "package"
# - "target" => ""
parts = modname.split(".")
parts = [part for part in parts if part.startswith("+")]
modname = ".".join(parts)

... instead of the change currently implemented in this PR?

@joeced
Copy link
Collaborator

joeced commented Mar 24, 2024

Hi @rdzman thanks for the contribution. On your question in #245 (comment) I have not had time to test it and will be away from the computer the next week. Sorry about that.

@rdzman
Copy link
Contributor Author

rdzman commented Mar 26, 2024

I just pushed another commit that does completely remove those lines. This is what I'm currently using since it appears to address both #243 and most of the issues in #246.

@rdzman
Copy link
Contributor Author

rdzman commented Mar 26, 2024

I also pushed a commit that addresses an auto-link failure in the context outlined in #243.

@rdzman
Copy link
Contributor Author

rdzman commented Mar 26, 2024

Sorry ... I didn't check closely enough before pushing ... those commits actually broke a lot of things (e.g. lots of links no-longer active). I may have another go at this, but I'm definitely in over my head, so no promises.

@rdzman rdzman force-pushed the link-short-name-match-modname branch from 5c2b20e to 253361d Compare May 3, 2024 19:13
@rdzman
Copy link
Contributor Author

rdzman commented May 3, 2024

I just rebased this branch on the latest master and omitted the commit/reversal related to #245.

As it stands now, this branch appears to fix #243 for me, but @joeced, you still probably want to have a look to see what you think of the "solution".

@joeced joeced merged commit f73ea8a into sphinx-contrib:master May 7, 2024
31 checks passed
@joeced joeced linked an issue May 7, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't link function short name if it matches module name
2 participants