Show the glossary definition when a user hovers over some Git jargon #2040
+248
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was thinking about how Git has a lot of jargon (
tree-ish
,pathspec
,refspec
,commit-ish
,reset
,index
, etc) which even very experienced Git users often aren't familiar with, and how Git has a glossary where (at least in theory) a lot of the jargon is defined, but that glossary isn't very discoverable. It seems like there's a design intention with the man pages where if there's some text inside angle brackets (like<tree-ish>
, then you're supposed to be able to look up that text in the glossary. What if looking it up as simple as just hovering over the term?So I hacked together a way to show the glossary entry for a piece of jargon when someone hovers over it with their mouse. You can see it in action here: https://jvns.github.io/git-scm.com/docs/git-checkout
If folks thinks this seems like an interesting idea, I can work on resolving some of the issues with the current hacked-together approach, like:
<angle brackets>
, like<tree-ish>
. It would be nice to be able to mark things outside of angle brackets as jargon, but I'm not sure how to accomplish that yetHere's a screenshot:
