feat: render markdown in packages' LongDescription
Alan Pearce alan@alanpearce.eu
Fri, 17 May 2024 23:01:17 +0200
4 files changed, 11 insertions(+), 3 deletions(-)
M frontend/static/style.css → frontend/static/style.css
@@ -125,3 +125,7 @@ margin: unset; font-size: 1.25rem; display: inline-block; } + +blockquote > p { + margin: unset; +}
M frontend/templates/blocks/packages.gotmpl → frontend/templates/blocks/packages.gotmpl
@@ -11,7 +11,11 @@ {{ .Attribute }} {{- end }} </h3> </summary> - <p>{{ or .LongDescription .Description }}</p> + {{- if .LongDescription }} + {{ markdown .LongDescription }} + {{- else }} + <p>{{ .Description }}</p> + {{- end }} <dl> {{- with .MainProgram }} <dt>Main Program</dt>
M internal/importer/package.go → internal/importer/package.go
@@ -234,7 +234,7 @@ PackageSet: pkgSet, Version: i.pkg.Version, Broken: i.pkg.Meta.Broken, Description: i.pkg.Meta.Description, - LongDescription: i.pkg.Meta.LongDescription, + LongDescription: nix.Markdown(i.pkg.Meta.LongDescription), Homepages: i.pkg.Meta.Homepages, MainProgram: i.pkg.Meta.MainProgram, Platforms: i.pkg.Meta.Platforms,
M internal/nix/package.go → internal/nix/package.go
@@ -9,7 +9,7 @@ Definition string Description string Homepages []string Licenses []License - LongDescription string + LongDescription Markdown MainProgram string Maintainers []Maintainer PackageSet string