commit edb595278fa098693b8d32dc5d9fc93a9dbb1a4f
parent c403421ec2bdbab61fdcb59de4ed689d51218cbb
Author: Vincent Forest <vaplv@free.fr>
Date: Fri, 1 Sep 2017 12:49:36 +0200
Add a makefile and add version number to the generated solstice doc
Diffstat:
3 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -2,4 +2,5 @@
*.[ao]
*~
tags
+man
diff --git a/Makefile b/Makefile
@@ -0,0 +1,33 @@
+# Copyright (C) |Meso|Star> 2017
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+SOLSTICE-DIR=~/code/star-engine-solstice/local
+
+.PHONY: default
+default: all
+
+.PHONY: all
+all: solstice
+
+.PHONY: solstice
+solstice:
+ @tput bold
+ @echo -e ">>> Generate Solstice doc from '$(SOLSTICE-DIR)'"
+ @tput sgr0
+ @sh ./solstice-gen-refdoc.sh $(SOLSTICE-DIR)
+
+.PHONY: clean
+clean:
+ @rm -rf man
diff --git a/solstice-gen-refdoc.sh b/solstice-gen-refdoc.sh
@@ -1,5 +1,20 @@
#!/bin/bash
+# Copyright (C) |Meso|Star> 2017
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
set -e
if [ $# -lt 1 ]; then
@@ -12,6 +27,18 @@ if [ ! -d $1 ]; then
exit 1
fi
+if [ ! -f $1/bin/solstice ]; then
+ echo "Cannot find the solstice program."
+ exit 1
+fi
+
+version=$(echo `readlink $1/bin/solstice` | sed 's/solstice-\(.*\)/\1/g')
+
+if [ "$version" == "" ]; then
+ echo "Cannot retrieve the solstice version."
+ exit 1
+fi
+
man_pages=(
"solstice 1"
"solstice-input 5"
@@ -54,9 +81,8 @@ print_header() {
done
echo ' </ul>'
echo '</div>'
- echo ''
echo '<div id=content>'
- echo ''
+ echo "<div style=\"font-variant: small-caps; float: right; color: #777777\">Version $version</div>"
echo '<header>'
echo " <h1>$name($num)</h1>"
echo '</header>'
@@ -86,6 +112,7 @@ for((i=0; i<${#man_pages[@]}; ++i)); do
mkdir man/man${entry[1]}
fi
+ echo "Write $output"
print_header ${entry[0]} ${entry[1]} > $output
man2html -r $man_path | tail -n +30 | sed '/^<HR>$/,$d' | sed '/\ /d' | sed 's/<DL COMPACT>/<DL>/g' >> $output
if [ "${entry[0]}" == "solstice" ]; then