Johnny Decimal Index Generator for Obsidian with Dataview
You will need to enable JavaScript Queries in the Dataview settings.
let areas = dv.pages("").file.folder.groupBy(g=>g.split("/")[0]).filter(({ key }) => /^\d{2}-\d{2} /.test(key))
let output = ''
areas.forEach(({ key: areaKey, rows: areaRows }) => {
output += `\n- ${areaKey}`
areaRows.groupBy(g => g.split("/")[1]).forEach(({ key: categoryKey, rows: categoryRows }) => {
if (/^\d{2} /.test(categoryKey)) {
output += `\n - ${categoryKey}`
dv.pages(`"${areaKey}/${categoryKey}"`).file.forEach(({ link: contentKey }) => {
output += `\n - ${contentKey}`
})
}
})
})
dv.paragraph(output)
Output
- 00-09 System
- 00 Index
- 01 Inbox
- 02 Notes
- 03 TODOs
- 04 Bookmarks
- 05 Templates
- 08 Someday
- 09 Archive