|| Metaviews | Resolving State (C)﹕ Covered


These concepts go up to another concept which is not a set. The resting directory is the name of that concept.


let pages = dv.pages('"Concepts/Concepts"')
    .where(p => p.file.path.includes("/(C)/"));
 
// Group by the directory immediately before "/(A)/"
let grouped = pages.groupBy(p => {
    let path = p.file.path;
    let match = path.match(/([^\/]+)\/\(C\)\//);
    return match ? match[1] : "Unknown";
});
 
// Display grouped results with sub-grouping
for (let group of grouped) {
    dv.header(3, group.key);
    
    // Sub-group by immediate parent directory of the file
    let subGrouped = group.rows.groupBy(p => {
        let path = p.file.path;
        let parts = path.split('/');
        // Get the parent directory (second to last element)
        return parts.length >= 2 ? parts[parts.length - 2] : "Root";
    });
    
    for (let subGroup of subGrouped) {
        dv.header(6, subGroup.key);
        dv.list(subGroup.rows.map(p => p.file.link));
    }
}

Details

  • They get the subs hook. If they are themselves sets, they get the subsets hook.
  • All directories are in a single flat layer immediately following /(C)/.