Skip to content

Commit

Permalink
don't use anchor links for reference
Browse files Browse the repository at this point in the history
felixroos committed Nov 6, 2023
1 parent 395ae4d commit 07da9a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions website/src/repl/Reference.jsx
Original file line number Diff line number Diff line change
@@ -14,12 +14,20 @@ export function Reference() {
<div className="flex h-full w-full pt-2 text-foreground overflow-hidden">
<div className="w-42 flex-none h-full overflow-y-auto overflow-x-hidden pr-4">
{visibleFunctions.map((entry, i) => (
<a key={i} className="cursor-pointer block hover:bg-lineHighlight py-1 px-4" href={`#doc-${i}`}>
<a
key={i}
className="cursor-pointer block hover:bg-lineHighlight py-1 px-4"
onClick={() => {
const el = document.getElementById(`doc-${i}`);
const container = document.getElementById('reference-container');
container.scrollTo(0, el.offsetTop);
}}
>
{entry.name} {/* <span className="text-gray-600">{entry.meta.filename}</span> */}
</a>
))}
</div>
<div className="break-normal w-full h-full overflow-auto pl-4 flex relative">
<div className="break-normal w-full h-full overflow-auto pl-4 flex relative" id="reference-container">
<div className="prose dark:prose-invert max-w-full pr-4">
<h2>API Reference</h2>
<p>

0 comments on commit 07da9a9

Please sign in to comment.