Skip to content

Commit

Permalink
Add permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 2, 2024
1 parent 493ae91 commit 101f631
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webgpu/lessons/resources/lesson.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ table {
position: relative;
}

.permalink>div {
position: absolute;
transform: translateX(-1em);
font-size: 19px;
}

.footnote {
font-size: smaller;
vertical-align: baseline;
Expand Down
6 changes: 6 additions & 0 deletions webgpu/lessons/resources/lesson.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ $(document).ready(function($) {
});

$('[data-table]').html();
$('a[id]:not([href])')
.addClass('permalink')
.each(function(i, e) {
$(e).attr('href', `#${$(e).attr('id')}`);
})
.append('<div class="permalink">#</div>');

});
}(jQuery));
Expand Down

0 comments on commit 101f631

Please sign in to comment.