mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add fragment links to sub-headers in docs (fixes #61)
Allows users to copy links to sub-headers within docs.
This commit is contained in:
@@ -72,3 +72,10 @@ a.doc-table-anchor {
|
||||
.td-default main section.td-cover-block p.lead strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.td-page,.td-section {
|
||||
main a.header-link {
|
||||
color: inherit;
|
||||
font-size: 60%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,3 +10,10 @@
|
||||
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
{{ partial "hooks/body-end.html" . }}
|
||||
|
||||
<script type="text/javascript">
|
||||
$("body.td-page,body.td-section").find("main h2,h3,h4").each(function() {
|
||||
var fragment = $(this).attr('id');
|
||||
$(this).append(' <a href="#'+fragment+'" class="header-link"><i class="fas fa-link"></i></a>');
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user