nixos-search
nixos-search copied to clipboard
Render Markdown in option docs for flakes and longDescription
Closes https://github.com/NixOS/nixos-search/issues/535, closes https://github.com/NixOS/nixos-search/issues/525
To do:
- [x] We're currently creating a new temporary file containing the xref lua filter for each Pandoc invocation. This is bad. I think it would generally be nicer to package the files we need (pandoc filters,
flake_info.nix
) alongsideflake-info
: we could set aDATADIR
variable in the Nix build that is detected at compile time and, if unset, defaults toCARGO_MANIFEST_DIR
so thatcargo run
still finds the files. - [x] The
pandoc
crate does not let us define precisely the flavour of Markdown we want (Commonmark with a few extensions) because it does not expose all of Pandoc's formats and extensions (notablycommonmark_x
and+fenced_divs
). For now I've set the format tomarkdown
, which is hopefully a superset, but if finer control is needed we will have to ~invoke pandoc directly~ or fork the crate. At least manpage references seem to render fine. Ping @jtojnar @pennae - [x] There seems to be a regression with
nix-security
. EDIT: this is a bug exposed by makingFlakeEntry
tagged: we don't support multiple licenses in flake packages, so previously flake packages with a list of licenses were parsed as apps instead.
🚀 Deployed on https://632899fb7bd5b614cc23836f--nixos-search.netlify.app
Ah, markdown
requires a blank line before lists whereas commonmark
doesn't. That settles it, let's switch to commonmark.
I've added Markdown rendering for longDescription
.
As a reminder/note to self, XSS sanitisation is done by Elm.
@ysndr ping
(or @garbas)
Looks good, and brings in some welcome cleanup Thank you @ncfavier Is there a way to see the result in the preview?
Ah, I shouldn't have merged so soon. The nixpkgs-unstable import is currently broken (but a fix is underway), so that channel will be rolled back a bit until the next update.
Also it seems like the flake import is hitting GitHub API rate limits. Fix: https://github.com/NixOS/nixos-search/pull/553