Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
This repository was archived by the owner on Oct 11, 2023. It is now read-only.

Implement rendering for payload with multiple levels #7

@parisk

Description

@parisk

Here we should also start adding classes according to each entry's type

Example

Input

[
  {
    "name":".git",
    "absolute_path":"/mnt/project/.git",
    "type":"directory",
    "children":null
  },
  {
    "name":".gitignore",
    "absolute_path":"/mnt/project/.gitignore",
    "type":"file",
    "children":null
  },
  {
    "name":"Gopkg.lock",
    "absolute_path":"/mnt/project/Gopkg.lock",
    "type":"file",
    "children":null
  },
  {
    "name":"Gopkg.toml",
    "absolute_path":"/mnt/project/Gopkg.toml",
    "type":"file",
    "children":null
  },
  {
    "name":"main.go",
    "absolute_path":"/mnt/project/main.go",
    "type":"file",
    "children":null
  },
  {
    "name":"vendor",
    "absolute_path":"/mnt/project/vendor",
    "type":"directory",
    "children":[
      {
        "name":"package.json",
        "absolute_path":"/mnt/project/vendor/package.json",
        "type":"file",
        "children":null
      },
      {
        "name":"yarn.lock",
        "absolute_path":"/mnt/project/vendor/yarn.lock",
        "type":"file",
        "children":null
      }
    ]
  }
]

Output

<ul class="fs-api-tree">
  <li class="fs-api-entry fs-api-directory" >
    <div class="fs-api-entry-name">.git</div>
  </li>
  <li class="fs-api-entry fs-api-directory">
    <div class="fs-api-entry-name">vendor</div>
    <ul class="fs-api-tree">
      <li class="fs-api-entry fs-api-file">
        <div class="fs-api-entry-name">package.json</div>
      </li>
      <li class="fs-api-entry fs-api-file">
        <div class="fs-api-entry-name">yarn.lock</div>
      </li>
    </ul>
  </li>
  <li class="fs-api-entry fs-api-file">
    <div class="fs-api-entry-name">.gitignore</div>
  </li>
  <li class="fs-api-entry fs-api-file">
    <div class="fs-api-entry-name">Gopkg.lock</div>
  </li>
  <li class="fs-api-entry fs-api-file">
    <div class="fs-api-entry-name">Gopkg.toml</div>
  </li>
  <li class="fs-api-entry fs-api-file">
    <div class="fs-api-entry-name">main.go</div>
  </li>
</ul>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions