From 8bc4fab26797a171f9a1a82b4f46925199a3c07e Mon Sep 17 00:00:00 2001 From: ryangreenup Date: Fri, 24 Jul 2020 20:37:07 +1000 Subject: [PATCH] How to Back Links --- docs/tools/BackLinks.md | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 docs/tools/BackLinks.md diff --git a/docs/tools/BackLinks.md b/docs/tools/BackLinks.md new file mode 100644 index 0000000..dd2b14b --- /dev/null +++ b/docs/tools/BackLinks.md @@ -0,0 +1,42 @@ +--- +title: Back Links +--- + +# Display Back Links +!!! note + Start this with `cadmus tools backlinks` + +## What does it do + +This takes a notes path from the clipboard and displays in the terminal any files that link to it using either: + +- `[markdown](./links.md)` +- `[[wiki-links]]` + +## How Do I use it + +Copy a note path to the clipboard then run `cadmus tools backlinks`, any notes that link to it will be displayed in the terminal. + +## When Would This Be Used + +This is handy when you have some piece of code, somewhere, that you can't find but you're sure you linked to. + +### Example + +![](./media/How-To-BackLinks.gif) + +## How does it Work + +This is just more `ripgrep`: + +```bash +rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \ + ~/Notes/MD/notes \ + -t markdown -ol +``` + +!!! note + See the script in `/bin/tools/List-Backlinks.sh` + + +