summaryrefslogtreecommitdiff
path: root/phpdoc.sh
diff options
context:
space:
mode:
authorOlivier Gayot <og@satcom1.com>2017-12-29 14:20:12 +0100
committerOlivier Gayot <og@satcom1.com>2017-12-29 14:20:12 +0100
commitd4c4123c514b0a1826cc13ad924fb883c2d43698 (patch)
treeb62ac9bd846cf5163816e2ce5e1e9ce807586973 /phpdoc.sh
parent94e5c852bc0d92c3d409c91c7afd886f11499e00 (diff)
Render the documentation through w3m
Signed-off-by: Olivier Gayot <og@satcom1.com>
Diffstat (limited to 'phpdoc.sh')
-rw-r--r--phpdoc.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpdoc.sh b/phpdoc.sh
index e705532..cfd140d 100644
--- a/phpdoc.sh
+++ b/phpdoc.sh
@@ -3,6 +3,8 @@
set -u
set -e
+W3M="$(/usr/bin/which w3m)" || true
+
function usage
{
echo "Usage: $0 -f <function>"
@@ -11,8 +13,14 @@ function usage
function lookup_function
{
local name="$1"
+ local filename="function.$(echo "${name}" | /usr/bin/sed 's/_/-/g').html"
+
+ if [ ! -n "${W3M}" ]; then
+ echo "w3m not found."
+ exit 1;
+ fi
- echo "Looking up function $name"
+ ${W3M} "/usr/share/doc/php/php-chunked-xhtml/${filename}"
}
opt_f=