From 330e4e36238a4e66af0da7b6d3ecfbdc147d08ec Mon Sep 17 00:00:00 2001 From: "chenyee.cy.huang" Date: Wed, 8 Jan 2025 01:46:49 +0800 Subject: [PATCH 1/5] Try to render array of object in component docs --- website/layouts/partials/data.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 26f4232ce720f..fcdcd676f04d5 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -135,6 +135,10 @@ + {{ if eq $k "object" }} + {{ template "config-object" (dict "name" $name "config" $v "level" 4) }} + {{ end }} + {{ with $v.examples }} {{ template "config-array-examples" (dict "examples" .) }} {{ end }} From 17660600c5045b00776fb2fd2dc5ebbb25e22da7 Mon Sep 17 00:00:00 2001 From: "chenyee.cy.huang" Date: Wed, 8 Jan 2025 02:09:08 +0800 Subject: [PATCH 2/5] Add some margin between rendering config-object in array block --- website/layouts/partials/data.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index fcdcd676f04d5..88dab99f232d5 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -136,7 +136,9 @@ {{ if eq $k "object" }} +
{{ template "config-object" (dict "name" $name "config" $v "level" 4) }} +
{{ end }} {{ with $v.examples }} From a3d369c96eb93f89362a51ed8f2718322c56a073 Mon Sep 17 00:00:00 2001 From: "chenyee.cy.huang" Date: Wed, 8 Jan 2025 11:26:36 +0800 Subject: [PATCH 3/5] Add some margin on top of config object and decrease the margin in array example --- website/layouts/partials/data.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 88dab99f232d5..0450604b69c93 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -136,7 +136,7 @@ {{ if eq $k "object" }} -
+
{{ template "config-object" (dict "name" $name "config" $v "level" 4) }}
{{ end }} @@ -1636,7 +1636,7 @@

{{ define "config-array-examples" }} {{ $json := .examples | jsonify (dict "indent" " ") }} -
+
Examples From 40b255eccd5231f27b29ae9f831994d8b5ffc63e Mon Sep 17 00:00:00 2001 From: "chenyee.cy.huang" Date: Thu, 9 Jan 2025 23:09:00 +0800 Subject: [PATCH 4/5] Remove array's `syntax` rendering since it's not defined in schema --- website/layouts/partials/data.html | 1 - 1 file changed, 1 deletion(-) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 0450604b69c93..5ddefe1aa1144 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -131,7 +131,6 @@ {{ partial "badge.html" (dict "word" $k "color" "gray") }} - {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }} From ff6f9c8761c3171e495d93b22dc3d49e9038e4ed Mon Sep 17 00:00:00 2001 From: "chenyee.cy.huang" Date: Thu, 9 Jan 2025 23:57:53 +0800 Subject: [PATCH 5/5] conditional render syntax field for array type --- website/layouts/partials/data.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/website/layouts/partials/data.html b/website/layouts/partials/data.html index 5ddefe1aa1144..41268850ad469 100644 --- a/website/layouts/partials/data.html +++ b/website/layouts/partials/data.html @@ -131,6 +131,9 @@ {{ partial "badge.html" (dict "word" $k "color" "gray") }} + {{ if $v.syntax }} + {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }} + {{ end }}