Skip to content

Commit

Permalink
Merge pull request #791 from tidalcycles/fix-ref-anchors
Browse files Browse the repository at this point in the history
don't use anchor links for reference
  • Loading branch information
felixroos committed Nov 6, 2023
2 parents 395ae4d + 07da9a9 commit 682ac25
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
Expand Up @@ -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>
Expand Down

0 comments on commit 682ac25

Please sign in to comment.