Add more info on hover on cross-references in gitbook/bs4_book?
I am reading the R Markdown cookbook that includes many cross-references to other pages. I think it'd be neat if when hovering on one of these cross-references, I got a preview of the page (title, first sentence). E.g. at the top of https://bookdown.org/yihui/rmarkdown-cookbook/indent-text.html I'd like to be able to remember what section 4.12 is without having to click (even if the URL itself that I see on hover is a bit informative).
I think this issue is related to #689.
I don't know how this would work, maybe with html5 data attributes. The feature is also similar to bs4_book() making footnotes available on hover.
By filing an issue to this repo, I promise that
- [x] I have fully read the issue guide at https://yihui.org/issue/.
- [x] I have provided the necessary information about my issue.
- If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
- If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included
xfun::session_info('bookdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/bookdown'). - If I have posted the same issue elsewhere, I have also mentioned it in this issue.
- [x] I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
I think this is a great idea!
Some references of the tool that can be used for this: distill is using tippy and popover for some tooltip / popover (https://github.com/rstudio/distill/commit/3a83b0288d3ddc4ae4977dcfa48e8b713d1d02e6)
And with bootstrap this is included: https://getbootstrap.com/docs/4.0/components/tooltips/ (which is what bs4_book() uses)