Links break quietly. A page on another site moves, someone renames an image, a document is moved to a new folder, and the link that worked last year now leads nowhere. In a folder of Markdown files, such as product documentation, a knowledge base or the source of a website, you only find out when a reader complains.
This guide shows how to check every link in one document, or in a whole folder and its subfolders, with Rons Markdown Edit, and how to fix what it finds.
What Gets Checked
The link check reads every address in the document and gives each one a status:
- Exists: the address answered, or the file is there
- Moved: the web address redirects to another address; you can update the link to that new address
- Missing: the page or file could not be found
- Other: the address could not be checked, or returned another answer
A web address is requested, so your computer needs an internet connection while the check runs. Only the addresses are requested; the text of your document is not sent anywhere.
A file link, such as images/screenshot.png or
../guide/setup.md, is checked from the folder of the saved document.
A relative path only makes sense once the file has been saved, so save a new
document before checking it.
Anchors (#heading) and mailto,
telephone, script and data addresses are listed but not requested.
Check One Document
- Open the document.
- Choose Edit → Links, or click Links on the toolbar. The Activity panel opens at the bottom.
- Choose whether to list only the broken links or every link.
- Click a result to jump to that link in the text.
Check a Whole Folder
- Choose File → Open Location... (or Open Location... on the Start Page) and select the top folder of your documents.
- In the Locations panel, open the Links tab.
- Run the check. Rons Markdown Edit goes through the Markdown, HTML and plain text files in the folder and its subfolders.
- Results are grouped by file. Open a result to go straight to that place in the document.
This is an easy way to tidy a documentation folder before you publish it, or after you have moved files around.
Fix What You Find
From the links panel you can:
- Change one address, for example to the new location of a page that moved
- Change every link that uses the same address, when one page or file is linked from many places
- Remove a link that is missing or could not be checked
If a file link is Missing because you renamed or moved the file, you can also fix it at the source: in the Locations panel, rename or move the file back, or use copy relative path on the file and paste the correct path into the link.
To replace one address in many files at once, you can also use the folder Search tab with replace turned on; it writes each change back to the files, and files that are already open are changed in the editor.
Good Habits
- Prefer relative links between documents in the same folder tree, so the folder can move without breaking them.
- Check before publishing, and again after renaming or moving files.
- Treat Moved as a to-do: the link still works today, but updating it to the new address avoids a future break.
-
Keep images next to the documents that use them, in a folder
such as
images, so the links stay short.
Other Ways to Check Links
If your documents live in a Git repository with automated builds, command-line link checkers such as markdown-link-check or mlc can run on every change. They are a good safety net for a team. Rons Markdown Edit is the easier route when you want to see the problems, open them and fix them in one place on your own computer.
Try It
The link check is included in the free Lite edition of Rons Markdown Edit, which has every editing feature and no time limit: download Rons Markdown Edit.