Render descriptions as Markdown (#667)
* Render descriptions as Markdown Following https://github.com/NixOS/nixpkgs/pull/237557, DocBook descriptions are not supported any more. We cannot use options.json any more because it still has DocBook descriptions in 22.11, so read the options from the modules directly. * Bump VERSION
This commit is contained in:
parent
b5acb880d1
commit
f31c2a395e
|
@ -156,7 +156,10 @@ rec {
|
|||
all = packages ++ apps ++ options;
|
||||
|
||||
# nixpkgs-specific, doesn't use the flake argument
|
||||
nixos-options = lib.mapAttrsToList (name: option: option // { inherit name; })
|
||||
(builtins.fromJSON (builtins.unsafeDiscardStringContext (builtins.readFile
|
||||
"${(import <nixpkgs/nixos/release.nix> {}).options}/share/doc/nixos/options.json")));
|
||||
nixos-options = readNixOSOptions {
|
||||
module = import <nixpkgs/nixos/modules/module-list.nix> ++ [
|
||||
<nixpkgs/nixos/modules/virtualisation/qemu-vm.nix>
|
||||
{ nixpkgs.hostPlatform = "x86_64-linux"; }
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -117,18 +117,11 @@ impl Serialize for DocString {
|
|||
S: Serializer,
|
||||
{
|
||||
match self {
|
||||
DocString::String(db) => {
|
||||
serializer.serialize_str(&db.render_docbook().unwrap_or_else(|e| {
|
||||
warn!("Could not render DocBook content: {}", e);
|
||||
db.to_owned()
|
||||
}))
|
||||
}
|
||||
DocString::DocFormat(DocFormat::MarkdownDoc(md)) => {
|
||||
serializer.serialize_str(&md.render_markdown().unwrap_or_else(|e| {
|
||||
DocString::String(md) | DocString::DocFormat(DocFormat::MarkdownDoc(md)) => serializer
|
||||
.serialize_str(&md.render_markdown().unwrap_or_else(|e| {
|
||||
warn!("Could not render Markdown content: {}", e);
|
||||
md.to_owned()
|
||||
}))
|
||||
}
|
||||
})),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue