nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

Add tooltips from devenv

Open proofconstruction opened this issue 2 years ago • 2 comments

devenv has a really nice interactive tooltip feature for code blocks, allowing the reader to click a button at the end of a line to reveal a message with additional context.

devenv

This might be nice to have in nix.dev also.

My main concern was how to integrate this feature in a way where non-Javascript web clients can still see that information, but it renders the list of just fine. Here's an example from the eww browser.

devenv-eww

proofconstruction avatar Sep 05 '23 17:09 proofconstruction

It's a feature from mkdocs-material: https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations

devenv doesn't use Sphinx but mkdocs: https://www.mkdocs.org/

yukiisbored avatar Sep 21 '23 07:09 yukiisbored

There is a version of the mkdocs-material theme that is ported for Sphinx: https://jbms.github.io/sphinx-immaterial/index.html

And it has the code-annotations feature: https://jbms.github.io/sphinx-immaterial/code_annotations.html

yukiisbored avatar Sep 21 '23 07:09 yukiisbored