Add anchors in `definition` shortcode (#1802)

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
pull/1805/head^2
Kévin Commaille 7 months ago committed by GitHub
parent 7201042894
commit a0bc6e7f83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1 @@
Add anchors in `definition` shortcode.

@ -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