diff --git a/dashboard/src/components/toc-sidebar.js b/dashboard/src/components/toc-sidebar.js new file mode 100644 index 0000000..7986db9 --- /dev/null +++ b/dashboard/src/components/toc-sidebar.js @@ -0,0 +1,29 @@ +/** + * toc-sidebar — inject a persistent widget into Observable Framework's + * right-column table-of-contents sidebar. + * + * Observable Framework renders a non-scrolling TOC aside (#observablehq-toc) + * in the right column. This helper lets you prepend a custom element to it, + * replacing any previously injected element with the same id on each call so + * reactive cells can refresh the widget without accumulating duplicates. + * + * Usage: + * import {injectTocTop} from "./components/toc-sidebar.js"; + * + * const el = html`
make api`}
-