1
Fork 0
mirror of https://github.com/RGBCube/HTMNIX synced 2025-07-24 22:47:43 +00:00

Don't HTML-ify <nixpkgs> and handle lists properly

This commit is contained in:
RGBCube 2024-03-04 10:50:03 +03:00
parent 53bc65d910
commit 7f54a2fedc
No known key found for this signature in database

View file

@ -27,6 +27,9 @@
then "<${dropLast 1 name}/>"
else "<${name}>";
# When doing <name>, these won't return HTML tags.
propagatedFindFiles = [ "nixpkgs" ];
in {
inherit (escapix) raw;
inherit lib;
@ -37,12 +40,17 @@
result = self.call /${builtins.getEnv "TARGET_FILE"};
__findFile = _: name: {
__findFile = env: name: if builtins.elem name propagatedFindFiles then __findFile env name else {
outPath = dottedNameToTag name;
__functor = this: next:
# Not an attrset. Just add it onto the HTML.
if !lib.isAttrs next
# Is a list. Consume each item. Treat it as if it was passed in one by one.
if lib.isList next
then lib.foldl' (this: this) (this (lib.head next)) (lib.tail next)
# Not an attrset or list.
# Just add it onto the HTML after stringifying it.
else if !lib.isAttrs next
then this // {
outPath = (toString this) + escape (toString next);
}