dead-links 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,10 +17,11 @@ npx dead-links report --vault "my-vault" --output report.md
17
17
  | Command | Description |
18
18
  |---------|-------------|
19
19
  | `dead-links scan` | Full scan: broken links + orphan notes + graph |
20
- | `dead-links broken` | Show only broken links |
20
+ | `dead-links broken` | Show only broken links with smart suggestions |
21
21
  | `dead-links orphans` | Show only orphan notes |
22
22
  | `dead-links graph` | Show connection graph |
23
23
  | `dead-links report` | Generate a `.md` report file |
24
+ | `dead-links stats` | **NEW** Show detailed vault statistics |
24
25
 
25
26
  ### scan
26
27
 
@@ -29,13 +30,16 @@ dead-links scan [options]
29
30
 
30
31
  Options:
31
32
  --vault <path> Path to the Obsidian vault (default: current directory)
32
- --format <type> Output format: text, json, markdown (default: text)
33
+ --format <type> Output format: text, json, markdown, csv, html, mermaid, dot (default: text)
33
34
  --output <file> Save output to a file
34
35
  --ignore <patterns...> Glob patterns to ignore
35
36
  --attachments Also check embedded attachments (images, PDFs)
36
37
  --ignore-folders <folders> Exclude folders from orphan report
37
38
  --quiet Only show issues, no stats
38
39
  --no-color Disable colored output
40
+ --suggestions Show smart suggestions for broken links
41
+ --debug Enable debug mode with verbose output
42
+ --fix Auto-fix broken links using generated suggestions
39
43
  ```
40
44
 
41
45
  ### broken
@@ -48,6 +52,8 @@ Options:
48
52
  --ignore <patterns...> Glob patterns to ignore
49
53
  --attachments Also check embedded attachments
50
54
  --verbose Show line numbers and full details
55
+ --suggestions Show smart suggestions for broken links
56
+ --debug Enable debug mode
51
57
  ```
52
58
 
53
59
  ### orphans
@@ -84,14 +90,54 @@ Options:
84
90
  --ignore <patterns...> Glob patterns to ignore
85
91
  ```
86
92
 
93
+ ### stats
94
+
95
+ ```bash
96
+ dead-links stats [options]
97
+
98
+ Options:
99
+ --vault <path> Path to the Obsidian vault (default: current directory)
100
+ --ignore <patterns...> Glob patterns to ignore
101
+ --debug Enable debug mode
102
+
103
+ Shows:
104
+ • Total notes and links count
105
+ • Average links per note
106
+ • Vault health score
107
+ • Most connected notes
108
+ • Orphan notes preview
109
+ • Connected components
110
+ ```
111
+
87
112
  ## Quick Start
88
113
 
89
114
  ```bash
90
- # Full scan
91
- npx dead-links scan --vault "my-vault"
115
+ # Full scan with suggestions
116
+ npx dead-links scan --vault "my-vault" --suggestions
92
117
 
93
- # Check for broken links only with verbose output
94
- npx dead-links broken --vault "my-vault" --verbose
118
+ # Check for broken links with suggestions
119
+ npx dead-links broken --vault "my-vault" --suggestions
120
+
121
+ # Detailed vault statistics
122
+ npx dead-links stats --vault "my-vault"
123
+
124
+ # Interactive HTML report
125
+ npx dead-links scan --vault "my-vault" --format html --output report.html
126
+
127
+ # CSV export for spreadsheets
128
+ npx dead-links scan --vault "my-vault" --format csv --output issues.csv
129
+
130
+ # Graph visualization (Mermaid diagram)
131
+ npx dead-links scan --vault "my-vault" --format mermaid --output graph.md
132
+
133
+ # Graph visualization (GraphViz/DOT format)
134
+ npx dead-links scan --vault "my-vault" --format dot --output graph.dot
135
+
136
+ # Markdown report
137
+ npx dead-links report --vault "my-vault" --output report.md
138
+
139
+ # Debug mode (verbose)
140
+ npx dead-links scan --vault "my-vault" --debug
95
141
 
96
142
  # Include attachments in the check
97
143
  npx dead-links scan --vault "my-vault" --attachments
@@ -102,9 +148,6 @@ npx dead-links scan --vault "my-vault" --ignore-folders Films Diary Books
102
148
  # JSON output for scripts/CI
103
149
  npx dead-links scan --vault "my-vault" --format json
104
150
 
105
- # Generate markdown report
106
- npx dead-links report --vault "my-vault" --output report.md
107
-
108
151
  # Ignore patterns
109
152
  npx dead-links scan --vault "my-vault" --ignore "**/Templates/**" "**/.trash/**"
110
153
 
@@ -117,7 +160,28 @@ npx dead-links scan --vault "my-vault" --no-color
117
160
  # Show orphan notes list
118
161
  npx dead-links orphans --vault "my-vault" --verbose
119
162
  ```
163
+ ## Opening Reports
120
164
 
165
+ After generating a report with `--output`, you can open it with:
166
+
167
+ ```bash
168
+ # Windows
169
+ start report.html
170
+
171
+ # macOS
172
+ open report.html
173
+
174
+ # Linux
175
+ xdg-open report.html
176
+
177
+ # Or navigate to the file in your file explorer and double-click it
178
+ ```
179
+
180
+ The generated files are saved in your current directory:
181
+ - `report.html` - Open in any web browser
182
+ - `issues.csv` - Open with Excel, Google Sheets, or any spreadsheet app
183
+ - `graph.md` - View in GitHub, Obsidian, or any markdown viewer
184
+ - `graph.dot` - Render with Graphviz: `dot -Tpng graph.dot -o graph.png`
121
185
  ## Output Format
122
186
 
123
187
  ```
@@ -152,10 +216,63 @@ Create a `.deadlinksrc.json` in your vault root for persistent settings:
152
216
  {
153
217
  "ignore": ["**/Templates/**", "**/.trash/**"],
154
218
  "ignoreFolders": ["Films", "Trunk", "Diary", "Books", "Games"],
155
- "checkAttachments": false
219
+ "checkAttachments": false,
220
+ "suggestions": true,
221
+ "debug": false,
222
+ "fix": false
156
223
  }
157
224
  ```
158
225
 
226
+ ## Output Formats
227
+
228
+ ### Text (default)
229
+ Colorful terminal output with stats, broken links, and orphan notes grouped by folder.
230
+
231
+ ### JSON
232
+ Machine-readable format for automation and scripting.
233
+
234
+ ### Markdown
235
+ Human-readable report with sections for broken links and orphan notes.
236
+
237
+ ### CSV
238
+ Tabular format compatible with Excel, Google Sheets, and data analysis tools.
239
+
240
+ ### HTML
241
+ Beautiful interactive dashboard with:
242
+ - Live search and filtering
243
+ - Stats cards with metrics
244
+ - Sortable tables
245
+ - Most connected notes preview
246
+ - Responsive design
247
+
248
+ ### Mermaid
249
+ Graph visualization in Mermaid syntax. Render in:
250
+ - GitHub README files
251
+ - Obsidian notes
252
+ - Notion docs
253
+ - Online editors (mermaid.live)
254
+
255
+ ### GraphViz (DOT)
256
+ Professional graph format for advanced visualization tools:
257
+ - Graphviz CLI: `dot -Tpng graph.dot -o graph.png`
258
+ - Online: webgraphviz.com
259
+
260
+ ## Smart Suggestions
261
+
262
+ The `--suggestions` flag uses Levenshtein distance algorithm to recommend fixes for broken links:
263
+
264
+ ```bash
265
+ npx dead-links broken --vault "my-vault" --suggestions
266
+ ```
267
+
268
+ Example output:
269
+ ```
270
+ 💡 Suggestions:
271
+ MyNote → MyNotes (95%)
272
+ ProjectXY → ProjectXYZ (87%)
273
+ Article2 → Article1 (72%)
274
+ ```
275
+
159
276
  ## CI/CD
160
277
 
161
278
  Exit code is `0` if no issues found, `1` if issues exist. Perfect for CI pipelines.