BUILD_DEPS = appdoc_
+ifeq ($(filter quiet,$(APPDOC)),quiet)
+QUIET = -quiet
+endif
+
appdoc_: FORCE
@echo " Making application documentation for $(COMPONENT) on $(PLATFORM)"
# first generate the xml files
- nesdoc -o build $(NESDOC_FLAGS) $(PFLAGS) $(CFLAGS) $(COMPONENT).nc -app
+ nesdoc -o build $(NESDOC_FLAGS) $(PFLAGS) $(CFLAGS) $(COMPONENT).nc -app $(QUIET)
# generate html from the xml files
- nesdoc -o build -html -target=$(PLATFORM)
+ nesdoc -o build -html -target=$(PLATFORM) $(QUIET)
PFLAGS += -preserve
endif
+ifeq ($(filter quiet,$(DOCS)),quiet)
+QUIET = -quiet
+endif
+
BUILD_DEPS = docs_
docs_: FORCE
@echo " Making documentation for $(COMPONENT) on $(PLATFORM)"
# first generate the xml files
- nesdoc -o $(DOCDIR) $(NESDOC_FLAGS) $(PFLAGS) $(CFLAGS) $(COMPONENT).nc
+ nesdoc -o $(DOCDIR) $(NESDOC_FLAGS) $(PFLAGS) $(CFLAGS) $(QUIET) $(COMPONENT).nc
ifneq ($(filter nohtml,$(DOCS)),nohtml)
# generate html from the xml files
- nesdoc -o $(DOCDIR) -html -target=$(PLATFORM) $(DOCS)
+ nesdoc -o $(DOCDIR) -html $(QUIET) -target=$(PLATFORM)
endif
return check(xml_tagfind(x, tag))
def usage():
- print "Usage: %s [-t dir] [--topdir dir] [--preserve] [--app] repository" % argv[0]
+ print "Usage: %s [-t dir] [--topdir dir] [--preserve] [--app] [--quiet] repository" % argv[0]
print " where -t/--topdir specify prefixes to remove from file names"
print " to create nice, package-like names for interface and components"
print " (based on their full filename)."
print " If --preserve is specified, existing XML files are preserved."
print " If --app is specified, a page for this application is created in the"
print " current directory."
+ print " If --quiet is specified, the program is less verbose."
print " The XML input is read from stdin."
# Return package name for elem, or None if no valid name is found
return dirname
# option processing. See usage string for details.
-(opts, args) = getopt(argv[1:], "t:", [ "topdir=", "preserve", "app" ])
-topopts = filter(lambda (x): x[0] != "--preserve" and x[0] != "--app", opts)
+(opts, args) = getopt(argv[1:], "t:", [ "topdir=", "preserve", "app", "quiet" ])
+topopts = filter(lambda (x): x[0] != "--preserve" and x[0] != "--app" and x[0] != "--quiet", opts)
preserve = filter(lambda(x): x[0] == "--preserve", opts) != []
app = filter(lambda(x): x[0] == "--app", opts) != []
+quiet = filter(lambda(x): x[0] == "--quiet", opts) != []
topdirs = map(lambda (x): canonicalisedir(x[1]), topopts)
if len(args) != 1:
usage()
filename = "interfaces/%s.xml" % nicename
if preserve and os.path.exists(filename):
continue
- # print "interface %s (%s)" % (name, nicename)
+ if not quiet:
+ print "interface %s (%s)" % (name, nicename)
doc = creator.createDocument(None, None, None)
copy = x.cloneNode(True)
doc.appendChild(copy)
filename = "components/%s.xml" % nicename
if preserve and os.path.exists(filename):
continue
-
- # print "component %s (%s)" % (name, nicename)
+ if not quiet:
+ print "component %s (%s)" % (name, nicename)
doc = creator.createDocument(None, None, None)
# copy component and create its specification
copy = x.cloneNode(True)
# Generate HTML files, and a global index for all interfaces and components
# in the specified repository
-repository = argv[1]
+if argv[1] == "--quiet":
+ repository = argv[2]
+ quiet = True
+else:
+ repository = argv[1]
+ quiet = False
+
try:
chdir(repository)
for intf in intffiles:
if search("\\.xml$", intf):
- #stderr.write("interface " + intf + "\n")
+ if not quiet:
+ stderr.write("interface " + intf + "\n")
ixml = parse("interfaces/" + intf)
generate_interface(ixml.documentElement)
ixml.unlink()
for comp in compfiles:
if search("\\.xml$", comp):
- #stderr.write("component " + comp + "\n")
+ if not quiet:
+ stderr.write("component " + comp + "\n")
ixml = parse("components/" + comp)
generate_component_graph(ixml.documentElement)
generate_component(ixml.documentElement)
TinyOS 2.x: collect documentation from a program:
.br
\fBnesdoc\fR -o \fIdocumentation-directory\fR [\fB-preserve\fR]
- [\fB-new\fR] [\fB-target=\fIplatform\fR] [\fB-topdir=\fIdirectory\fR]
- [\fIncc-options\fR] \fIfiles...\fR
+ [\fB-new\fR] [\fB-quiet\fR] [\fB-target=\fIplatform\fR] [\fB-topdir=\fIdirectory\fR]
+ [\fIncc-options\fR] \fIfiles...\fR
TinyOS 2.x: generate nesdoc HTML pages:
.br
-\fBnesdoc\fR -o \fIdocumentation-directory\fR [\fB-new\fR] [\fB-target=\fIplatform\fR] \fB-html\fR
+\fBnesdoc\fR -o \fIdocumentation-directory\fR \fB-html\fR
+ [\fB-new\fR] [\fB-quiet\fR] [\fB-target=\fIplatform\fR]
.SH DESCRIPTION
\fB-new\fR
Force the use of the new nesdoc even when using a TinyOS 1.x source tree.
.TP
+\fB-quiet\fR
+Don't print informational messages.
+.TP
\fB-topdir=\fIdir\fR
Specify directory paths that should be stripped from the source file names
when generating "package names" for the documentation files. The directory
$app = 1;
$strip = 1;
}
+ elsif (/^-quiet$/) {
+ $quiet = 1;
+ $strip = 1;
+ }
}
push @ncc_args, $_ if !$strip;
}
}
if ($genhtml) {
- execorfail($python, "$libprogs/nesdoc/genhtml.py", $docdir)
+ push @html_args, $python;
+ push @html_args, "$libprogs/nesdoc/genhtml.py";
+ push @html_args, "--quiet" if $quiet;
+ push @html_args, $docdir;
+ execorfail(@html_args);
}
# Collecting nesdoc data. Run ncc, then process the results with
push @archive_args, "--topdir=$toscontainer";
push @archive_args, "--preserve" if $preserve;
push @archive_args, "--app" if $app;
+push @archive_args, "--quiet" if $quiet;
push @archive_args, "$docdir";
unshift @archive_args, "$libprogs/nesdoc/archive.py";
unshift @archive_args, $python;