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

Support sphinxcontrib-bibtex #96

Closed
choldgraf opened this issue Nov 10, 2020 · 6 comments · Fixed by #149
Closed

Support sphinxcontrib-bibtex #96

choldgraf opened this issue Nov 10, 2020 · 6 comments · Fixed by #149
Labels
Feature New feature

Comments

@choldgraf
Copy link

It would be quite useful if this plugin could be used to support sphinxcontrib-bibtex on top of other Sphinx references. That way you could hover over a citation, and get a read-out of the content that the citation points to.

@humitos humitos added the Feature New feature label Nov 11, 2020
@humitos
Copy link
Member

humitos commented Nov 11, 2020

Interesting. I've never used sphinxcontrib-bibtex, but taking a look at its documentation and how it renders the cite, I think it's possible to support it.

@choldgraf do you have an example of a project that has sphinx-hoverxref enabled and uses sphinxcontrib-bibtex as well?

I did a small test hitting this URL https://readthedocs.org/api/v2/embed/?project=sphinxcontrib-bibtex&url=https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html%23nel87 and I got an interesting reply

We may only need to handle this as a special case (in the parser from the server), similarly as we do with dt inside a glossary.

@choldgraf
Copy link
Author

do you have an example of a project that has sphinx-hoverxref enabled and uses sphinxcontrib-bibtex as well?

I can always create one if need be, but not right now :-) right now Jupyter Book doesn't work with readthedocs, so we haven't been able to test hoverxref behavior in it

@humitos
Copy link
Member

humitos commented Nov 11, 2020

I can always create one if need be, but not right now :-)

Nah. Don't worry. I was asking just in case that you were already using it.

right now Jupyter Book doesn't work with readthedocs

😢 --I'm willing this to happen soon! 🤞 Jupyter Book has lot of potential!

@choldgraf
Copy link
Author

I think it shouldn't be too much work and definitely something we'd love as well. I opened up an issue to track what kinds of things need to happen for this to be possible:

jupyter-book/jupyter-book#1091

@humitos
Copy link
Member

humitos commented Nov 24, 2020

The backend is updated and ready to handle the request. Now, if you run this command, you get exactly what you need to show inside the tooltip (just the citation text).

▶ curl --silent https://readthedocs.org/api/v2/embed/\?project\=sphinxcontrib-bibtex\&url\=https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html%23nel87 | jq ".content"
[
  "<dd><p>Edward Nelson. <em>Radically Elementary Probability Theory</em>. Princeton University Press, 1987.</p>\n</dd>"
]

The only work missing is on the extension itself, that should find sphinxcontrib-bibtex nodes and inject the hoverxref data- attributes to work.

@humitos
Copy link
Member

humitos commented Sep 27, 2021

@choldgraf Hi! I opened #149 and I hope it would be included in the next release that's going to be available in the following weeks.

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