Creates a refactorer, filling any option left unset with its default: relative paths preferred, Claude imports updated and formatting preserved.
Refactoring options, including an optional Obsidian vault context for wikilink-aware rewriting.
Updates the links inside a file that is itself being moved, so they still reach their targets from the new location. Reads the file from disk, does not write it, and records per-link failures in the result instead of throwing.
Parsed file that is being moved.
Path the file will be moved to.
OptionalmovedPaths: Map<string, string>
Map of old to new paths for other files moved in the same operation, so links to them are rewritten to their new locations.
The rewritten content, the changes made and any per-link errors.
Update links when the current file is being moved (with provided content)
OptionalmovedPaths: Map<string, string>Update links in a file when another file has been moved
Update links in a file when another file has been moved (with provided content)
Update reference-style link definitions
Refactors and updates markdown links when files are moved or restructured.
The LinkRefactorer automatically updates link paths, maintains referential integrity, and handles various link types including relative paths, absolute paths, and Claude import syntax. It ensures that links remain valid after file operations.
Example
Basic link refactoring
Example
Bulk refactoring with path mapping