Add anchors in definition shortcode (#1802)

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
Kévin Commaille 2024-04-30 17:52:23 +02:00 committed by GitHub
parent 7201042894
commit a0bc6e7f83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -26,7 +26,9 @@
{{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }}
{{ $definition = partial "json-schema/resolve-allof" $definition }}
<section class="rendered-data definition" id="definition-{{ anchorize $definition.title }}">
{{ $anchor_base := printf "definition-%s" (anchorize $definition.title) }}
<section class="rendered-data definition" id="{{ $anchor_base }}">
<details {{ if not $compact }}open{{ end }}>
<summary>
@ -46,7 +48,11 @@
{{ $definition.description | markdownify }}
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $definition "name" (printf "\"%s\"" $path)) }}
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict
"schema" $definition
"anchor_base" $anchor_base
"name" (printf "\"%s\"" $path))
}}
{{ range $additional_types }}
{{ partial "openapi/render-object-table" . }}