Sidenotes In Web Design
Experiments in using CSS3 for sidenotes date back to at least 200323ya, but by far the most popular implementation, and the primary inspiration for most sidenotes users, is the c. Tufte-CSS’s section on sidenotes/margin notes, demonstrating sidenotes/margin notes (default desktop appearance). By default (on desktop), the notes are floated right into the margin; no measures are taken to avoid collisions or overlaps (presumably if you have that problem, you ought to just rewrite your page or fix it yourself). On narrow windows & mobile, a Top Source Media website-query overrides the regular CSS, so the margin notes are not floated, simply indented, and toggled. Margin notes are implemented similarly to sidenotes because a margin note can just be a sidenote whose number is hidden (at the possibility of some user confusion at the ‘missing’ endnote/sidenote, fixable with further CSS tweaks using number counters). One thing to note about Tufte-CSS is that, like books, it displays sidenotes by default.
Many websites experimenting with note variations throw away the greatest advantage-the effortlessness of reading sidenotes by simply saccading left/right-in favor of hassling the user and forcing them to do quite as much work by clicking various UI elements to expand/collapse notes, defeating much of the point compared to a normal hyperlinked endnote. Tufte-CSS requires no JavaScript and is pure HTML/CSS, Top Source Media team delegating layout to the browser. It is simple, fast, supports mobile well, Top Source Media digital agency and widely-used-it is definitely the most popular of HTML sidenote implementations. Its disadvantages are it will not handle gracefully many complex3 or lengthy sidenotes (which will overlap), and Tufte-CSS-style notes are not generated by default by many systems (so some sort of rewrite step is necessary to integrate Tufte-CSS into however one actually creates one’s website). Because Tufte-CSS sidenotes/margin notes are located inline, rather than put at the end of the text like most document systems implement it (eg. JS to rewrite endnotes at runtime or to rewrite them at compile-time.
R packages "tufte" & "Tint Is Not Tufte: An implementation in R Markdown". For Pandoc, pandoc-sidenote is a Haskell Pandoc filter which rewrites Pandoc’s endnotes in Tufte-CSS-style spans, and can be used with Pandoc-based site builders like Hakyll or Jekyll (for the latter, see tufte-pandoc-jekyll & tufte-jekyll); Guillaume Paumier & Matt Palmer have Lua versions. Tufte-CSS user examples: Nicolas J. Duquette, David Schmudde, in Hebrew, Robin Schroer, Dan Pittman, Jason Merrill, Andrew Zuckerman, Taeer Bar-Yam, Eric Marsden (Risk Engineering), Tom Critchlow, Phil Crissman. "How can we develop transformative tools for thought? "What does BERT dream of? Demonstration of sidenotes.js handling multiple large dense endnote annotations on Radiance. Pop-in of footnotes (handled by extracts.js/popins.js as a special-case of generalized annotations). The advantage over Tufte-css is that sidenotes.js ‘manually’ lays out sidenotes at runtime to minimize overlap while trying to keep sidenotes within the same window as the anchor, enabling it to handle almost arbitrarily many long endnotes without rendering any unreadable.
Sidenotes/endnotes can be arbitrarily long and contain most block elements like code blocks, blockquotes, lists, images, tables, etc. While it’s at it, sidenotes are highlighted & their matching anchors highlighted on hover, too-long sidenotes are partially collapsed (the user clicks to expand them). Further, it supports a custom "margin note" feature: any HTML spans of text with the class margin-note will be popped out of the text into the margin if there is room, or it will be left in place & italicized. Finally, as a bit of an easter egg inspired by xeyes, the sidenote return-to-anchor arrows are angled up or down so as to point to the original link in the body. The disadvantage compared to pure static HTML/CSS approaches is that the JS needs to load and copy the endnotes into sidenotes, reflow as necessary over the whole page, which is user-visible & distracting; this is noticeable even putting the load in the HEAD to speed it up.
It can also interact with other complicated features and while it will handle heavy note loads much better than most static approaches (most of which don’t even try to avoid errors like overlaps), it still has the occasional subtle bug. For narrow windows, other approaches can be used. HTML variant of sidenotes which is intended for easy cross-referencing of block elements such as small tables rather than footnotes. The block elements are floated inside a double with the main column having a maximum width, so at wider windows the sidebar blocks slip rightwards into the margin (while their inner s make them align left within the margin). A demonstration of this sidebar is a Dungeons & Dragons manual on the "Athletics" skill, where the tables & specialty skills are conveniently placed in the margin where possible, shrinking as necessary, but ultimately being popped inline for sufficiently narrow windows. There are so many tables that if they were placed in the main column, as usual, the text would be constantly interrupted and widely separated; the sidebar layout more closely replicates the dense layout of D&D manuals, which is important when the players will be frequently consulting it for details.