From 51f5b90080de72dc6a0199239fe434bcde67c2ed Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Fri, 28 Apr 2023 11:25:39 +1200 Subject: [PATCH] Correct remaining html-bound links --- archive_crawler | 8 +++++++- start.md | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/archive_crawler b/archive_crawler index 11ced65..85c08a9 100644 --- a/archive_crawler +++ b/archive_crawler @@ -188,10 +188,16 @@ sed -i -e 's/\\/\| :warning: /' ./**/*.md sed -i -e 's/\\<\/note\\>/ |\n| --- |/' ./**/*.md # Let's correct any internal links so that they point to their new .md homes -mapfile -t mdlist < <(grep -o "\[.*\]\(.*\)" start.md | grep -v http | cut -d '(' -f2 | cut -d ')' -f1 | grep '/' | sort | uniq) +mapfile -t mdlist < <(grep -o "\[.*\]\(.*\)" start.md | grep -v http | cut -d '(' -f2 | cut -d ')' -f1 | cut -d '#' -f1 | grep '/' | sort | uniq) while read -r; do for target in "${mdlist[@]}"; do sed -i -e "s|${target}|${target}.md|g" "${REPLY}" done done < <(find . -name "*.md") + +# Because the pandoc output has a mix of markdown tables and html tables +# the above does not capture links within html tables. +# We're getting to the point that the bulk of this capture is done +# and we're over to manual corrections. But something like this may help: +# grep -R "href=\"/" * | grep -v ".*/.*\.md" diff --git a/start.md b/start.md index 5d6327d..7c1e750 100644 --- a/start.md +++ b/start.md @@ -145,7 +145,7 @@ attributes. export +href="/commands/builtin/export.md">export Display or set shell variables, also giving them the export attribute. typeset -x @@ -153,21 +153,21 @@ attribute. eval +href="/commands/builtin/eval.md">eval Evaluate arguments as shell code. - special builtin local +href="/commands/builtin/local.md">local Declare variables as having function local scope. - builtin readonly +href="/commands/builtin/readonly.md">readonly Mark variables or functions as read-only. typeset -r special builtin @@ -181,7 +181,7 @@ href="/commands/builtin/unset.md">unset shift +href="/commands/builtin/shift.md">shift Shift positional parameters - special builtin @@ -205,7 +205,7 @@ href="/syntax/keywords/coproc.md">coproc echo +href="/commands/builtin/echo.md">echo Create output from arguments. - builtin @@ -277,28 +277,28 @@ Commands that operate on data and/or affect control flow. colon +href="/commands/builtin/true.md">colon "true" null command. true special builtin dot +href="/commands/builtin/source.md">dot Source external files. source special builtin false +href="/commands/builtin/false.md">false Fail at doing nothing. - builtin continue / break +href="/commands/builtin/continueBreak.md">continue / break continue with or break out of loops. - special builtin @@ -312,7 +312,7 @@ href="/commands/builtin/let.md">let return +href="/commands/builtin/return.md">return Return from a function with a specified exit status. - special builtin @@ -341,35 +341,35 @@ href="/commands/builtin/exec.md">exec exit +href="/commands/builtin/exit.md">exit Exit the shell. - special builtin kill +href="/commands/builtin/kill.md">kill Send a signal to specified process(es) - builtin trap +href="/commands/builtin/trap.md">trap Set signal handlers or output the current handlers. - special builtin times +href="/commands/builtin/times.md">times Display process times. - special builtin wait +href="/commands/builtin/wait.md">wait Wait for background jobs and asynchronous lists. - builtin