wh0 / nix-cache-view

in-browser .nar explorer
https://wh0.github.io/nix-cache-view/
MIT License
12 stars 1 forks source link

More compact .nar file tree #3

Closed wh0 closed 1 year ago

wh0 commented 2 years ago

I think the layer of dl dd dt is unnecessarily bulky. I think we can make a more concise structure, provided that we have the "node" render its own directory entry name. Let's use a dummy value like "(root)" the store path for the directory entry name when we're rendering the root node.

Here are my ideas:

Regular

(name) (executable) (size) (create object url)

Symlink

(name) -> (target)

Directory

<details><summary>(name)</summary>
  <ul>
    <li>(entry)</li>
  </ul>
</details>

See around here for the current code that builds the tree https://github.com/wh0/nix-cache-view/blob/1a5bba2d55272506ff2f7c6af27cf0bf92d79474/nar.html#L55

Vanilla js + dom preferred. Sorry for the verbosity. It's more convenient for me to maintain this way without external dependencies.