NixOS / nix.dev

Official documentation for getting things done with Nix.
https://nix.dev
Creative Commons Attribution Share Alike 4.0 International
2.43k stars 242 forks source link

Add tooltips from devenv #710

Open proofconstruction opened 1 year ago

proofconstruction commented 1 year ago

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

yukiisbored commented 11 months ago

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 commented 11 months ago

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