rebuilt the generated HTML pages updated the stylesheets, added a

* doc/*.html: rebuilt the generated HTML pages
* doc/examples/*: updated the stylesheets, added a synopsis,
  Makefile.am is now generated by index.py
Daniel
diff --git a/doc/examples/index.py b/doc/examples/index.py
index ad88276..cbf66a0 100755
--- a/doc/examples/index.py
+++ b/doc/examples/index.py
@@ -12,6 +12,8 @@
 sys.path.append("..")
 from apibuild import CParser, escape
 
+examples = []
+extras = ['examples.xsl', 'index.py']
 sections = {}
 symbols = {}
 api_dict = None
@@ -96,6 +98,11 @@
     info = parse_top_comment(filename, parser.top_comment)
     output.write("  <example filename='%s'>\n" % filename)
     try:
+        synopsis = info['synopsis']
+	output.write("    <synopsis>%s</synopsis>\n" % synopsis);
+    except:
+        print "Example %s lacks a synopsis description" % (filename)
+    try:
         purpose = info['purpose']
 	output.write("    <purpose>%s</purpose>\n" % purpose);
     except:
@@ -126,7 +133,8 @@
         print "Example %s lacks a section description" % (filename)
     for topic in info.keys():
         if topic != "purpose" and topic != "usage" and \
-	   topic != "author" and topic != "copy" and topic != "section":
+	   topic != "author" and topic != "copy" and \
+	   topic != "section" and topic != "synopsis":
 	    str = info[topic]
 	    output.write("    <extra topic='%s'>%s</extra>\n" % str)
     output.write("    <includes>\n")
@@ -197,6 +205,42 @@
         output.write("    </section>\n")
     output.write("  </sections>\n")
 
+def dump_Makefile():
+    for file in glob.glob('*.xml'):
+        extras.append(file)
+    Makefile="""# Beware this is autogenerated by config.py
+INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
+DEPS = $(top_builddir)/libxml2.la
+LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@
+
+all: examples.xml index.html
+
+examples.xml: index.py *.c
+	-@($(srcdir)/index.py)
+
+index.html: examples.xml examples.xsl
+	-@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html)
+
+"""
+    EXTRA_DIST=""
+    for extra in extras:
+        EXTRA_DIST = EXTRA_DIST + extra + " "
+    Makefile = Makefile + "EXTRA_DIST=%s\n\n" % (EXTRA_DIST)
+    noinst_PROGRAMS=""
+    for example in examples:
+        noinst_PROGRAMS = noinst_PROGRAMS + example + " "
+    Makefile = Makefile + "noinst_PROGRAMS=%s\n\n" % (noinst_PROGRAMS)
+    for example in examples:
+        Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example,
+	       example, example)
+    try:
+	old = open("Makefile.am", "r").read()
+	if old != Makefile:
+	    n = open("Makefile.am", "w").write(Makefile)
+	    print "Updated Makefile.am"
+    except:
+        print "Failed to read or save Makefile.am"
+    
 if __name__ == "__main__":
     load_api()
     output = open("examples.xml", "w")
@@ -204,9 +248,11 @@
 
     for file in glob.glob('*.c'):
 	parse(file, output)
+	examples.append(file[:-2])
 
     dump_symbols(output)
     dump_sections(output)
     output.write("</examples>\n")
     output.close()
+    dump_Makefile()