Skip to content

Commit

Permalink
Create site with documentation #164
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Mar 3, 2024
1 parent 7510581 commit 338ead5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ echo 'Please reopen the shell to activate completion.'

Find some contributor instructions in [DEVELOPER.md](docs/DEVELOPER.md).

#### AWK
### AWK

The core of this tool is implemented in [AWK](https://en.wikipedia.org/wiki/AWK).
Almost all major implementations of AWK will work. Tested and officially supported are [Gawk](https://www.gnu.org/software/gawk/), [BWK](https://github.com/onetrueawk/awk), [mawk](https://invisible-island.net/mawk/). This means that the default AWK implementation in your OS will work.
Expand Down
8 changes: 5 additions & 3 deletions mdbooker.awk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BEGIN {
OUTDIR = "book"
SUMMARY = OUTDIR "/SUMMARY.md"
printf "" > SUMMARY
N = 0
H = 0
Title = ""
Content = ""
Expand All @@ -15,13 +16,14 @@ BEGIN {

function handleTitle(h, md) {
if (Title) {
md = Title ".md"
N++
md = (N < 10 ? "0": "") N "_" Title ".md"
print "generating: " md "..."
print Content > md
print Content > OUTDIR "/" md
printf "%" ((H - 1) * 4) "s%s[%s](%s)\n", "", 1 == H ? "" : "-", Title, md >> SUMMARY
}
H = h
Title = trim(substr($0, h))
Title = trim(substr($0, h+1))
Content = ""
}

Expand Down

0 comments on commit 338ead5

Please sign in to comment.