]> git.ipfire.org Git - thirdparty/systemd.git/blob - tools/make-index-md.sh
travis: use systemd as PID1 in debian containers
[thirdparty/systemd.git] / tools / make-index-md.sh
1 #!/bin/sh
2
3 set -eu
4
5 cd "$@"/docs/
6 (
7 echo -e "# systemd Documentation\n"
8
9 for f in *.md ; do
10 if [ "x$f" != "xindex.md" ] ; then
11 t=`grep "^# " "$f" | head -n 1 | sed -e 's/^#\s*//'`
12
13 if [ "x$f" = "xCODE_OF_CONDUCT.md" -o "x$f" = "xCONTRIBUTING.md" ] ; then
14 # For some reason GitHub refuses to generate
15 # HTML versions of these two documents,
16 # probably because they are in some way special
17 # in GitHub behaviour (as they are shown as
18 # links in the issue submission form). Let's
19 # work around this limitation by linking to
20 # their repository browser version
21 # instead. This might not even be such a bad
22 # thing, given that the issue submission form
23 # and our index file thus link to the same
24 # version.
25 u="https://github.com/systemd/systemd/blob/master/docs/$f"
26 else
27 u="https://systemd.io/"`echo "$f" | sed -e 's/.md$//'`
28 fi
29 echo "* [$t]($u)"
30 fi
31 done
32 ) > index.md