Ostatnio aktywny 1732918280

johnny-decimal-index-for-obsidian-with-dataview.md Surowy

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

Links