JuliaDocs / DocumenterCitations.jl

DocumenterCitations.jl uses Bibliography.jl to add support for BibTeX citations and references in documentation pages generated by Documenter.jl.
https://juliadocs.github.io/DocumenterCitations.jl/
MIT License
72 stars 5 forks source link

Show reference on hover #67

Open goerz opened 11 months ago

goerz commented 11 months ago

Clicking on a citation takes the reader out the current context, as it generally links to the References page of the project. Even though the browser's back button will return the location of the citation, it can still be disorienting.

A nicer experience would be to show the full reference when hovering over the citation. A similar feature for footnotes was requested in https://github.com/JuliaDocs/Documenter.jl/issues/2080.

As mentioned there, this feature may be possible to implement with pure CSS, or it might require some javascript. And example for javascript that implements something like this would be https://www.jqueryscript.net/text/Inline-Footnotes-On-Hover.html (demo).

Adding javascript functionality to DocumenterCitations would raise the question on how a user would set this up. We already have instructions for manually adding CSS. Adding .js files to that (especially if they're required for the plugin to function properly) might be a bit too much. It would be good have have capabilities in Documenter to enable plugins to inject custom css/js, see https://github.com/JuliaDocs/Documenter.jl/issues/1612.

On the other hand, if https://github.com/JuliaDocs/Documenter.jl/issues/2080 was implemented first, that might allow DocumenterCitations to just reuse that implementation.

shayandavoodii commented 11 months ago

Hi, 👋🏻

Adding .js files to that (especially if they're required for the plugin to function properly) might be a bit too much.

In my opinion, it's not. "Copy and paste" content that is pre-organized shouldn't be cumbersome :) I should highlight that this is my personal opinion and others might think differently.