Add anchors in definition shortcode

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
pull/1802/head
Kévin Commaille 3 weeks ago
parent 7201042894
commit 003e3b828a
No known key found for this signature in database
GPG Key ID: 29A48C1F03620416

@ -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" . }}

Loading…
Cancel
Save