add(5,11)
[1] 16
multiply(5,5)
[1] 25
Filip Reierson
April 30, 2024
In this article I share an approach to displaying documentation for user written functions in a quarto document using Tippy.js popups. The reason I started looking into this is that when I share progress in my PhD research I use a html document generated using quarto. In these reports I sometimes use functions that I have written myself which may not be fully self explanatory. To make it easier for someone reading my code, I decided to add documentation for these functions. However, navigating to a separate documentation page would interrupt the reader’s flow. Therefore, I developed my solution using the Tippy.js library.
Below is an example of the end result.
The code is available from freierson/docs-for-your-function-on-click-in-quarto. I admit this approach has many limitations and is not neat, but at the time of writing I have not found a better alternative for my particular use case. I hope others may also find it useful, at least as a starting point.