summaryrefslogtreecommitdiff
path: root/d
diff options
context:
space:
mode:
authorschodet2004-06-27 11:39:13 +0000
committerschodet2004-06-27 11:39:13 +0000
commitd75b00bb1d2cfdb8f142cf811e39e30fb621fde4 (patch)
tree1fd73e71b8a09c0709562a0fc311fda19dc364f9 /d
parent2f764ac0e5047129685ed4f01ffa0aeb30cdd81e (diff)
Initial revision
Diffstat (limited to 'd')
-rwxr-xr-xd/dev/sys/lampion/scripts/extractdoc49
-rwxr-xr-xd/dev/sys/lampion/scripts/update-doc41
2 files changed, 90 insertions, 0 deletions
diff --git a/d/dev/sys/lampion/scripts/extractdoc b/d/dev/sys/lampion/scripts/extractdoc
new file mode 100755
index 0000000..5d1c8ff
--- /dev/null
+++ b/d/dev/sys/lampion/scripts/extractdoc
@@ -0,0 +1,49 @@
+#!/usr/bin/perl -w
+use strict;
+
+while (<>)
+{
+ if (/^\/\*\*/)
+ {
+ my @doc;
+ my @def;
+ my $stop;
+ # Capture comments.
+ INNER: {
+ do {
+ chomp;
+ $stop = 1 if (/\*\//);
+ s/^\/? *\*+ ?//;
+ s/^ +/\t/;
+ s/^\t- *([^:-]+) *:/\t[$1]/;
+ s/ *\*\///;
+ push @doc, $_;
+ last INNER if defined $stop;
+ } while (<>);
+ }
+ # Capture definition.
+ $_ = <>;
+ if (/^# *define /)
+ {
+ INNER: {
+ do {
+ chomp;
+ push @def, $_;
+ last unless /\\$/;
+ } while (<>);
+ }
+ }
+ else
+ {
+ INNER: {
+ do {
+ chomp;
+ s/\).*/);/;
+ push @def, $_;
+ last if /\)/;
+ } while (<>);
+ }
+ }
+ print join "\n", @doc, '', '^<<', @def, '^>>', '', '';
+ }
+}
diff --git a/d/dev/sys/lampion/scripts/update-doc b/d/dev/sys/lampion/scripts/update-doc
new file mode 100755
index 0000000..bbebccf
--- /dev/null
+++ b/d/dev/sys/lampion/scripts/update-doc
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+docdir=/var/data/doc
+readme=README.html
+
+cd $docdir || exit 1
+
+exec &> /tmp/update-doc-output
+
+# Update CVS.
+
+for i in *
+do
+ if [[ -d "$i/CVS" ]]
+ then
+ cvs up "$i" || echo "Error in cvs up $i"
+ find "$i" -type d -exec test -r '{}/Makefile' ';' '(' -exec make -C '{}' doc ';' , -prune ')'
+ fi
+done
+
+exec 1> $readme
+
+cat <<EOF
+<pre>Codes :
+-------
+
+a : électronique analogique.
+b : bureau.
+d : divers (en rapport avec le robot, pas avec le bureau).
+i : informatique.
+n : électronique numérique.
+m : mécanique.
+
+Fichiers récents :
+------------------
+
+EOF
+find . -name CVS -prune -false -o -mtime -10 -not -type d | \
+sed -ne 's|^\./\(.*\)/\([^/]*\.html\)$|<a href="\1/">\1</a>/<a href="\1/\2">\2</a>|p' \
+ -e 's|^\./\(.*\)/\([^/]*\)$|<a href="\1/">\1</a>/\2|p'
+echo '</pre>'