libk  Diff

Differences From Artifact [fbe8d4ad27]:

To Artifact [b795aa8a1c]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env sh
(test -d global && test -f build.sh) || {
	echo >&2 "($0) run $me from root of libk source directory"
	exit 1
}

. global/common.sh
test "$out" = "" && {
	say "\$out environment variable must be set to your build directory - are you running this script by hand? run make doc in the root directory instead!"
	exit 2
}

if ! has cmark; then
	say "to generate documentation for libk, install the cmark package and try again"
	exit 3
fi


file="$1"
filename="$(basename "$file")"
stem=${filename%%.md}
mandest="$out/doc/man"
section=${section:-4}
out="$mandest/$stem.$section"
desc_rec="$(grep -m1 "^$name:" global/modules)"
if test $? -eq 0; then
	desc=" - $(echo $desc_rec | cut -d: -f4)"
else
	desc=""
fi
date="$(date -r"$file" "+%d %A %Y")"

mkdir -p "$mandest"

echo  >"$out" ".TH ${name^^} \"$section\" \"$date\" \"hale.su libk [r$build]\" \"modules\""

echo >>"$out" ".SH NAME"
echo >>"$out" "$stem$desc"
echo >>"$out" ".SH SYNOPSIS" 

dhead=$(grep -m1 -n "^# description$" "$file")
if test $? -eq 0; then







|
<
<
<
<
<
<
<
<








|
|








|







1
2
3
4
5
6
7
8








9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env sh
(test -d global && test -f build.sh) || {
	echo >&2 "($0) run $me from root of libk source directory"
	exit 1
}

. global/common.sh
reqpack cmark "generate documentation"










file="$1"
filename="$(basename "$file")"
stem=${filename%%.md}
mandest="$out/doc/man"
section=${section:-4}
out="$mandest/$stem.$section"
desc_rec="$(grep -m1 "^$stem:" global/modules)"
if test "$desc_rec" != ""; then
	desc=" - $(echo $desc_rec | cut -d: -f4)"
else
	desc=""
fi
date="$(date -r"$file" "+%d %A %Y")"

mkdir -p "$mandest"

echo  >"$out" ".TH ${stem^^} \"$section\" \"$date\" \"hale.su libk [r$build]\" \"modules\""

echo >>"$out" ".SH NAME"
echo >>"$out" "$stem$desc"
echo >>"$out" ".SH SYNOPSIS" 

dhead=$(grep -m1 -n "^# description$" "$file")
if test $? -eq 0; then