Skip to content

Commit

Permalink
Render HTML anchors for definition blocks (#1191)
Browse files Browse the repository at this point in the history
It's handy to be able to link to these.
  • Loading branch information
richvdh committed Aug 3, 2022
1 parent 569e139 commit dc4fd9b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
14 changes: 4 additions & 10 deletions assets/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,10 @@ footer {

}

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

/* Styles for the table of contents */
Expand Down
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1191.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Render HTML anchors for object definition tables.
2 changes: 1 addition & 1 deletion layouts/shortcodes/definition.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }}
{{ $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 }}>
<summary>
Expand Down

0 comments on commit dc4fd9b

Please sign in to comment.