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

Anyway to support tooltips for internal references created by numref? #70

Closed
kerimoyle opened this issue Apr 20, 2020 · 5 comments · Fixed by #71
Closed

Anyway to support tooltips for internal references created by numref? #70

kerimoyle opened this issue Apr 20, 2020 · 5 comments · Fixed by #71
Labels
Feature New feature

Comments

@kerimoyle
Copy link

Thanks for a great wee tool :)

I'm having trouble combining the numref role with tooltips - does it perhaps need another round of rendering in the same way that mathjax panels do? My conf.py file looks like this:

hoverxref_auto_ref = True
hoverxref_roles = ['ref', 'numref']
hoverxref_role_types = {
    'ref': 'tooltip',       
    'numref': 'tooltip',    
}

The pages are working fine for things which use the ref role, just not the numref one.

Readthedocs site is here: https://cellml-specification-dev.readthedocs.io/en/i314_numref_hoverxref/reference/formal_and_informative/specB09.html

If you have any suggestions I'd be very glad to hear them. Thanks!

@humitos
Copy link
Member

humitos commented Apr 20, 2020

Hi @kerimoyle! :numref: is not supported yet.

I think it won't be complicated to support it. We need to override the method _resolve_numref_xref in our Mixin for the std Domain.

Note to myself for the reference, the source code of that page is at https://github.com/kerimoyle/cellml-specification/blob/i314_numref_hoverxref/src/reference/sectionB_elements.inc#L293

@humitos humitos added the Feature New feature label Apr 20, 2020
@humitos
Copy link
Member

humitos commented Apr 20, 2020

Hey @kerimoyle! Would you like to test the branch from #71 in your project? I think that should add support for :numref:. Let me know if it does work. Thanks!

@kerimoyle
Copy link
Author

Hi @humitos! Thanks for the quick response :) I've had a go (same page as before) but we seem to get the same behaviour ... the output from the build is here. Do I need to do anything different in my code to get it to work?

@humitos
Copy link
Member

humitos commented Apr 20, 2020

You have this line commented out

# hoverxref_roles = ['ref', 'numref']

You need,

hoverxref_roles = ['numref']

Let me know if that makes the difference.

@kerimoyle
Copy link
Author

Fantastic! Yes, that's done it :) Thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants