all repos — searchix @ c0fbf11f843af84e8891a708c4d217dd6c523473

Search engine for NixOS, nix-darwin, home-manager and NUR users

feat: render markdown examples

Alan Pearce
commit

c0fbf11f843af84e8891a708c4d217dd6c523473

parent

7d08b696e9ab6de61c53a5dc9153595a5a8a6d98

1 file changed, 13 insertions(+), 5 deletions(-)

changed files
M frontend/templates/blocks/options.gotmplfrontend/templates/blocks/options.gotmpl
@@ -5,7 +5,7 @@ <summary>
{{ .Option }} </summary> <p> - {{ HTML .Description.HTML }} + {{ markdown .Description }} </p> <dl> {{- with .Type }}
@@ -15,18 +15,26 @@ {{- end }}
{{- with .Default }} <dt>Default</dt> <dd> - <pre><code>{{ .Text }}</code></pre> + {{- if .Markdown }} + {{ .Markdown }} + {{- else }} + <pre><code>{{ .Text }}</code></pre> + {{- end }} </dd> {{- end }} {{- with .Example }} - {{- if .Text }} + {{- if or .Text .Markdown }} <dt>Example</dt> <dd> - <pre><code>{{ .Text }}</code></pre> + {{- if .Markdown }} + {{ .Markdown }} + {{- else }} + <pre><code>{{ .Text }}</code></pre> + {{- end }} </dd> {{- end }} {{- end }} - {{- with .RelatedPackages.HTML }} + {{- with .RelatedPackages }} <dt>Related Packages</dt> <dd>{{ . }}</dd> {{- end }}