mdrename

command
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2019 License: MIT Imports: 11 Imported by: 0

README

Command mdrename renames/moves single markdown (.md) file, while scanning
for all .md files under current working directory, looking for links
referencing moved file. If it finds such files, it then updates links so
they point to new location.

Usage:

    mdrename file.md new-name.md

Note that since it may potentially update multiple files, the whole
operation is not atomic, it is advisable to only run it over files versioned
by VCS which can be restored in case of any errors.

Currently only inline links like [link](dst.md) are supported; links like
[link][id] are NOT supported. The reason for this is that links are updated
by substring replacements inside text, this may lead to some invalid
replacements, and handling only inline links somewhat reduces risk of
invalid replacements. Please check results before committing them.

If program succeeds in renaming file and updating all found references, and
"mdurlcheck" tool exists in PATH, then "mdurlcheck ." is called as a final
step, this way you can see whether any links (especially non-inline ones)
were missed.

Documentation

Overview

Command mdrename renames/moves single markdown (.md) file, while scanning for all .md files under current working directory, looking for links referencing moved file. If it finds such files, it then updates links so they point to new location.

Usage:

mdrename file.md new-name.md

Note that since it may potentially update multiple files, the whole operation is not atomic, it is advisable to only run it over files versioned by VCS which can be restored in case of any errors.

Currently only inline links like [link](dst.md) are supported; links like [link][id] are NOT supported. The reason for this is that links are updated by substring replacements inside text, this may lead to some invalid replacements, and handling only inline links somewhat reduces risk of invalid replacements. Please check results before committing them.

If program succeeds in renaming file and updating all found references, and "mdurlcheck" tool exists in PATH, then "mdurlcheck ." is called as a final step, this way you can see whether any links (especially non-inline ones) were missed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL