Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render HTML anchors for definition blocks #1191

Merged
merged 3 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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