System
Metrics
Analytics on notes including word count and outline extraction.
Metrics Module
Overview
Provides analytics on notes: word count and outline extraction.
Quick Start
const wc = await obsidian.metrics.wordCount('Notes/SomeNote.md');
console.log(`Words: ${wc}`);
const outline = await obsidian.metrics.outline('Notes/SomeNote.md');
console.log(outline);API Reference
| Method | Description |
|---|---|
wordCount(path) | Compute word count for a note. |
outline(path) | Extract an outline of headings from a note. |
Examples
// Word count
const wordCount = await obsidian.metrics.wordCount('Notes/Report.md');
// Generate outline
const toc = await obsidian.metrics.outline('Notes/Report.md');Best Practices
- Use
wordCountto enforce length guidelines. - Use
outlineto build navigation sidebars. - Metrics operate on the raw markdown content; they do not consider embedded media.