mirror of
https://github.com/RyanGreenup/cadmus.git
synced 2025-08-06 14:16:33 +02:00
Fix Backlinks
This commit is contained in:
@@ -1,19 +1,21 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
command -v rg >/dev/null 2>&1 || { echo >&2 "I require ripgrep but it's not installed. Aborting."; exit 1; }
|
command -v rg >/dev/null 2>&1 || { echo >&2 "I require ripgrep but it's not installed. Aborting."; exit 1; }
|
||||||
command -v sd >/dev/null 2>&1 || { echo >&2 "I require sd (sed replacement) but it's not installed. Aborting."; exit 1; }
|
command -v sd >/dev/null 2>&1 || { echo >&2 "I require sd (sed replacement) but it's not installed. Aborting."; exit 1; }
|
||||||
command -v xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed. Aborting."; exit 1; }
|
command -v xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed. Aborting."; exit 1; }
|
||||||
|
|
||||||
|
|
||||||
term=$(basename "${1}" | cut -f 1 -d '.')
|
term=$(basename "${1}" | cut -f 1 -d '.')
|
||||||
|
DIR="${2}"
|
||||||
|
|
||||||
|
|
||||||
rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \
|
rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \
|
||||||
"${NOTES_DIR}" \
|
"${DIR}" \
|
||||||
-t markdown -ol
|
-t markdown -ol
|
||||||
# ~/Notes/MD/notes \
|
# ~/Notes/MD/notes \
|
||||||
|
|
||||||
|
|
||||||
## If you want to preview the Backlinks
|
## If you want to preview the Backlinks
|
||||||
## rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \
|
## rg -e "\[.*\]\(.*$term\.md\)" -e "\[\[$term\]\]" -e "\[\[$term.*\]\]" \
|
||||||
## ~/Notes/ -t markdown -ol \
|
## ~/Notes/ -t markdown -ol \
|
||||||
|
Reference in New Issue
Block a user