-
Notifications
You must be signed in to change notification settings - Fork 4
New settings for links #13
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
Conversation
|
so there is "show the link symbol all the time", which ...is just a CSS change, right? I dont personally like it that way, so I wouldn't want that CSS change by default, if that's how this works. we could perhaps render a style class that refers to the two different approaches in the CSS. then as far as "make the name the link", how does that look? IIUC the build you have above is showing the link symbol still. I'm all for options here, so I think this should be just one configuruation parameter
what do you think? two PRs is easier for me to understand the two if it's not too much trouble |
Sorry, I should have been more explicit. "show the symbol all the time" was my first approach before we had the idea of making the parameter name a link. I did this by manually overriding the CSS file and this PR doesn't change the hover behavior. The change in the css file just makes sure that if the parameter name is a link, it doesn't change the text color. So except for the cursor changing on hovering the name, there is no visual indication for the link. I can try and provide you with an example built.
One parameter with different settings sounds reasonable 👍 I'll see if I implement the
Sure, no worries. Will do that later tonight or in the next few days |
|
I've moved the nitpicky thing to #14 and implemented the new config scheme. I've also added some info to the docs about that and how to customize styling. Also, here is a small preview of how it reneders with |
|
OK, ill try to have alook soon. |
|
you're still in my inbox. just have a lot coming in |
zzzeek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy new year! im back. i think this is good, tiny stylistic changes that are not super essential but here we are
|
Happy new year to you as well :) The requested changes make sense, so I pushed some along with adapting the readme. |
|
OK this looks great. going to squash the commits and reformat README and that's it! |
|
OK I'm going to force-push some changes here, but also param_name_and_link_symbol is nesting the tags, will see if I can fix that |
|
there is also a really weird and subtle recursion overflow happening here if i touch that code at all, i have a vague idea why it's happening but it's really weird. fixing that |
Pull requset courtesy Hinrich Mahler. Closes: sqlalchemyorg#13
|
OK note major differences, if you can re-review please:
I've tested a bunch and it seems to work for me, if you can give it a run to make sure it's doing what you need as well, thanks. |
|
Ah, I hadn't noticed the nesting thing. Thanks for finding! Enum & One comment on PS: I usually just "sqash & merge" PRs, which leaves the history in tact during the review process :) |
|
yes i thought if another symbol is added, BOTH starts to not make sense. will think about another name, but it starts to look like maybe the parameter should itself be a tuple, but that's probably not worth it. "versionadded" was totally a mistake as I thought i was in sphinx :) . |
|
OK please give my latest commit one more review and we can merge. |
|
LGTM 👌 |
|
great! thanks. will try to look at your next one in the coming week. |

Hi. After #12, I finally got around to play around with this more and would like to propose two additions:
This part was moved to #14
Better support for nitpicky mode. Currently,
:paramref:is resolved without checking if the resulting target exists. By checking against the index created inbuild_indexwithinlookup_paramsand returningNoneif the target doesn't exist, we give sphinx a chance to emit a warning about an unresolved reference, if needed. This minimal-effort approach has two downsides: First, the_sphinx_paramlinks_prefix is still included in the warning, e.g.Secondly, I don't know how well it plays with the
nitpick_ignoreandnitpick_ignore_regexsettings (I guess the prefix could mean trouble here)Alternatively, one could add an event handler for the
warn-missing-referenceevent, but the built-in logic of that is actually somewhat elaborate. At least for me, adapting this for sphinx-paramlinks is not worth the effort - I can live with the prefix and so far I don't use thenitpick_ignoresettingsAdd options to a) turn off the insertion of the link symbol after the parameter name and b) to make the parameter name itself the link. This idea came up at Docs improvements: referencing python-telegram-bot/python-telegram-bot#2798 (comment). The reason is that with the link symbol only showing on hover, there is a large gap between parameter name & description/type. But showing the link symbol just all the time also doesn't look too good:
that built is currently available here
If you like the general idea of those changes, I'm happy to discuss the implementation :) I can also split this PR up into two for the two different parts if you like that better.
Cheers!