Hi, thanks @scholarInTraining !
My low-effort improvement to your great code would be to slugify the inline keys. What it does it deletes duplicates like “Project” and “project” - Dataview likes to create these sort of variants just in case a user referes to the key in different ways each time.
function convertToSlug(Text) {
return Text.toLowerCase().replace(/ /g,'-').replace(/[-]+/g, '-').replace(/[^\w-]+/g,'');
}
const excludes = ["file", "aliases", "tags", "position", "links", "inlinks", "outlinks", "etags", "frontmatter", "lists", "tasks"];
let myFields = new Set();
Object.entries(dv.pages('"/"').values)
.forEach(([thing1, thing2]) =>
Object.keys(thing2)
.forEach(k => excludes.contains(k) ? 0 : myFields.add(convertToSlug(k)))
);
let myFieldsDV = dv.array(Array.from(myFields));
dv.list(myFieldsDV);