Render HTML anchors for definition blocks

It's handy to be able to link to these.
This commit is contained in:
Richard van der Hoff 2022-08-02 14:14:44 +01:00
parent 91aebd62c4
commit de322af49c
2 changed files with 5 additions and 11 deletions

View file

@ -165,16 +165,10 @@ footer {
} }
/* Adjust heading anchors for site header */ /* Adjust the scroll margin for everything in the main content, so that
.td-content { * it doesn't disappear behind the header bar */
&> h2, .td-content * {
&> h3, scroll-margin-top: 5.5rem;
&> h4,
&> h5,
&> h6,
.rendered-data h1 {
scroll-margin-top: 5rem;
}
} }
/* Styles for the table of contents */ /* Styles for the table of contents */

View file

@ -30,7 +30,7 @@
{{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }} {{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }}
{{ $definition = partial "json-schema/resolve-allof" $definition }} {{ $definition = partial "json-schema/resolve-allof" $definition }}
<section class="rendered-data definition"> <section class="rendered-data definition" id="{{ anchorize $definition.title }}">
<details {{ if not $compact }}open{{ end }}> <details {{ if not $compact }}open{{ end }}>
<summary> <summary>