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:
parent
53bc65d910
commit
7f54a2fedc
1 changed files with 11 additions and 3 deletions
14
flake.nix
14
flake.nix
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue