From 27105173c6ea84701e1ab82cdfb4a1a5683fff58 Mon Sep 17 00:00:00 2001 From: "Kyle J. Davis" Date: Fri, 22 Mar 2024 13:48:25 -0600 Subject: [PATCH 1/5] fixes issues with compound toml apiclient examples --- layouts/partials/settings-example-tab-pane.html | 12 ++++++++++-- layouts/partials/settings-setting-individual.html | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/layouts/partials/settings-example-tab-pane.html b/layouts/partials/settings-example-tab-pane.html index 6cbffd3a..192bbecc 100644 --- a/layouts/partials/settings-example-tab-pane.html +++ b/layouts/partials/settings-example-tab-pane.html @@ -52,8 +52,16 @@ {{ end }} {{ end }} {{ else }} - {{ $example_scratch.Add "out" (print "apiclient set " )}} - {{ $example_scratch.Add "out" (print $setting_full_name "=" $example.value) }} + {{/* compound toml examples have [ ] in them, so we have to use a regex to find and render alternately */}} + {{ if (findRE `\[(.*?)\]` $example.value) }} + {{ $example_scratch.Add "out" (print "apiclient apply <Note {{ $apiclientTabData.Set "toml" false }} {{ $apiclientTabData.Set "active" (not $hasToml) }} {{ $apiclientTabData.Set "example" $example }} + {{ $apiclientTabData.Set "prefix" $setting_prefix }}