Skip to content

Commit

Permalink
Add resource child type
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Oct 25, 2023
1 parent ce77a8c commit b9d90bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
},
Expand Down Expand Up @@ -568,7 +568,7 @@
Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
},
Expand Down Expand Up @@ -847,7 +847,7 @@
Path: /home/docs/rdvmohoro.mail.ccsctp.net/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
}
Expand Down Expand Up @@ -1141,7 +1141,7 @@
Path: /home/docs/rdvmohoro.mail.ccsctp.net/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev/index.md,
Exists: true,
Hidden: false,
Length: 4065
Length: 5051
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@
Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-dev/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
},
Expand Down Expand Up @@ -563,7 +563,7 @@
Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-prd/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
},
Expand Down Expand Up @@ -842,7 +842,7 @@
Path: /home/docs/291bba3f-e0a5-47bc-a099-3bdcb2a50a05/lab-stg/index.md,
Exists: true,
Hidden: false,
Length: 4062
Length: 5048
}
]
}
Expand Down Expand Up @@ -1136,7 +1136,7 @@
Path: /home/docs/72ac930a-f34e-42d8-b06d-dc2a9e12ed71/common-dev/index.md,
Exists: true,
Hidden: false,
Length: 4065
Length: 5051
}
]
}
Expand Down
18 changes: 12 additions & 6 deletions src/ARI/Commands/InventoryCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,32 @@ await writer.AddFrontmatter(
key => (key.Type.Split('/', count:2, options: StringSplitOptions.TrimEntries) is string[] { Length:>0} group)
? group[0]
: key.Type,
value => value,
value => (
SubType: (value.Type.Split('/', count: 2, options: StringSplitOptions.TrimEntries) is string[] { Length: > 1 } group)
? group[1]
: value.Type,
Resource: value
),
StringComparer.OrdinalIgnoreCase
);

await writer.WriteLineAsync(
"""
## Resources
| | |
|-|-|
| | | |
|-|-|-|
"""
);

foreach (var resourcesByType in resourcesByTypeLookup.OrderBy(key => key.Key, StringComparer.OrdinalIgnoreCase))
{
await writer.WriteLineAsync($"| **{resourcesByType.Key}** | |");
await writer.WriteLineAsync($"| **{resourcesByType.Key}** | | |");

foreach(var resource in resourcesByType.OrderBy(key => key.Description, StringComparer.OrdinalIgnoreCase))
foreach(var (subType, resource) in resourcesByType.OrderBy(key => key.Resource.Description, StringComparer.OrdinalIgnoreCase))
{
await writer.WriteLineAsync($"| {resource.Description.Link(resource.PublicId)} | {resource.Location.Link(resource.PublicId)} |");
await writer.WriteLineAsync($"| {resource.Description.Link(resource.PublicId)} | {subType.Link(resource.PublicId)} | {resource.Location.Link(resource.PublicId)} |");
}

await writer.WriteLineAsync("| | |");
Expand Down

0 comments on commit b9d90bc

Please sign in to comment.