-
Notifications
You must be signed in to change notification settings - Fork 370
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
Implement hover tooltips in documentation #2109
Conversation
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.
Thanks @mahdienan for all your hard work on this! I have a few minor English language and mark up suggestions.
Also can you please sort the glossary alphabetically (I think it's the option :sorted: but double check that).
@mahdienan: could you please merge master and resolve the conflict? Thanks! |
@mahdienan: any progress on this? Thanks! |
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.
Many thanks for your contribution!
I have added some inline comments and have two more general questions:
- Why are the three figures part of this PR? I'm fine if they have to be here, but would not want them in if they were added by accident.
- Shouldn't this (awesome!) new feature be applied to many more files (examples, documentation files)?
@jougs when we were discussing this project, we decided that we wanted this PR to focus mainly on the tool, with a few examples to showcase its usage. A subsequent PR will come to add this to other documentation. |
@jessica-mitchell: fine by me. Looking forward to that PR :-) Regarding the failing checks on GitHub Actions:
|
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.
thanks @mahdienan this works well both locally and on ReadtheDocs.
I just have a couple of minor changes I'd like to see to the glossary file. Remove the subtitle 'common abbreviations in nest' and add the option :sorted: after the glossary directive
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.
@mahdienan: I still would like to see the glossary descriptions consistently in upper (my preference) or lower case. As this is only a minor point, I approve now and leave the final decision to @jessica-mitchell.
…d dots at the end of definitions.
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.
I agree with @jougs and the descriptions that the first word should start with upper case letter.
@mahdienan can you do that pleae? I will approve also since it is a minor change.
thanks!
Fixed last conflict that came in due to merge of #2165 . Can be merged as soon as test pass. |
Many thanks! Merging :-) |
This pr implements a sphinx extension to allow hovering functionality in the documentation on ReadtheDocs. The content of the text when hovering is retrieved from the glossary file which was also updated. The extension uses a sphinx role defined in
_ext/HoverXTooltip.py
. To make the extension match the style of NEST, we make use ofCSS/JS defined in bootstrap.min.css
,bootstrap.min.js
, andhoverxtooltip.css
.The name of the role is
:hxt_ref:`TERM`
. This role looks for descriptions of a term in the glossary.rst file and adds the first line of the definition as the content of the pop-up. The hovering function can be also used by explicitly defining the content of the pop-up by using:hxt:`TERM <hxt:CONTENT>`
.In the glossary file entries, the first line of the descriptions for the terms will be displayed as the content of the pop-up and then there must be an empty line to prevent the entire text of the description from being displayed in the pop-up.
As an example, the PyNEST tutorials have been implemented. An example build can be found here.