Skip to content

Commit

Permalink
Create site with documentation #164 : fix #links
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Mar 6, 2024
1 parent 8380ddc commit b924bcf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mdbooker.awk
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ function handleTitle(h,pass, md,indent,dir,i,path) {

END { handleTitle(-1, 1); pass2() }

function pass2() {
function pass2( l) {
Title = Content = ""
while (getline < FILENAME > 0) {
if (match($0, /^#+/)) { handleTitle(RLENGTH, 2) }
else { Content = Content "\n" $0 }
else {
if (match(l = $0, /]\(#[^)]+\)/))
l = substr(l, 1, RSTART - 1) "](" Link2Path[substr(l, RSTART + 3, RLENGTH - 4)] ")" substr(l, RSTART + RLENGTH)
Content = Content "\n" l
}
}
handleTitle(-1, 2)
}
Expand Down

0 comments on commit b924bcf

Please sign in to comment.