Translation(s): none
This page contains various scripts used to produce some wiki content
pkg2wikipage
This bash snippet produces a paragraph with link to the specified package page on https://packages.debian.org and the contained manpage (hosted on https://manpages.debian.org)
1 function pkg2wikipage() {
2 pkg=$1
3
4 apt-cache search "^$pkg\$" | sed -e 's,^, * DebianPkg:,'
5 for p in $(dpkg -L $pkg | grep -E '/usr/share/man/man[18]/') ; do
6 s=$(echo $p |sed -e 's,.*/man\([0-9]\)/.*,\1,')
7 m=$(echo $p | sed -e 's,.*/\([^\.]*\)\..*,\1,' )
8 apropos -l -e -s $s $m | sed -e 's,^\([^ ]\+\) (\([^)]\)), * [[DebianMan:\2/\1|\1(\2)]],'
9 done
10 }
Sample output: running pkg2wikipage reportbug produces the MoinMoin markup:
* DebianPkg:reportbug - reports bugs in the Debian distribution * [[DebianMan:1/reportbug|reportbug(1)]] - reports a bug to a debbugs server * [[DebianMan:1/querybts|querybts(1)]] - view outstanding bug reports on a debbugs server
which is rendered as:
reportbug - reports bugs in the Debian distribution
reportbug(1) - reports a bug to a debbugs server
querybts(1) - view outstanding bug reports on a debbugs server
