diff options
author | Alan Pearce | 2025-03-18 22:40:46 +0100 |
---|---|---|
committer | Alan Pearce | 2025-03-19 17:33:58 +0100 |
commit | 896d844cac976afd0ee8aa73dd2fb28e15e7ac79 (patch) | |
tree | cc8d288d0039cb3d2084f43cafe8d4e0aea50e8b /internal/components/optionDetail.templ | |
parent | 1183108baa44fde88944e9207fb7763668c2b448 (diff) | |
download | searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.tar.lz searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.tar.zst searchix-896d844cac976afd0ee8aa73dd2fb28e15e7ac79.zip |
feat: Convert templ components to gomponents
Diffstat (limited to 'internal/components/optionDetail.templ')
-rw-r--r-- | internal/components/optionDetail.templ | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/internal/components/optionDetail.templ b/internal/components/optionDetail.templ deleted file mode 100644 index 6eaafb4..0000000 --- a/internal/components/optionDetail.templ +++ /dev/null @@ -1,58 +0,0 @@ -package components - -import "go.alanpearce.eu/searchix/internal/nix" - -templ OptionDetail(option nix.Option) { - <h2>{ option.Name }</h2> - @markdown(option.Description) - <dl> - if option.Type != "" { - <dt>Type</dt> - <dd><code>{ option.Type }</code></dd> - } - if option.Default != nil { - if option.Default.Text != "" || option.Default.Markdown != "" { - <dt>Default</dt> - <dd> - if option.Default.Markdown != "" { - @markdown(option.Default.Markdown) - } else { - <pre><code>{ option.Default.Text }</code></pre> - } - </dd> - } - } - if option.Example != nil { - if option.Example.Text != "" || option.Example.Markdown != "" { - <dt>Example</dt> - <dd> - if option.Example.Markdown != "" { - @markdown(option.Example.Markdown) - } else { - <pre><code>{ option.Example.Text }</code></pre> - } - </dd> - } - } - if option.RelatedPackages != "" { - <dt>Related Packages</dt> - <dd> - @markdown(option.RelatedPackages) - </dd> - } - if len(option.Declarations) > 0 { - <dt>Declared</dt> - for _, d := range option.Declarations { - <dd> - <a href={ templ.SafeURL(d.URL) }>{ d.Name }</a> - </dd> - } - } - </dl> -} - -templ OptionDetailPage(tdata TemplateData, option nix.Option) { - @Page(tdata) { - @OptionDetail(option) - } -} |