changeset 10637:63a8c3a186b9

pmccabe2html: Add css and css_url parameters.
author Simon Josefsson <simon@josefsson.org>
date Mon, 13 Oct 2008 12:20:30 +0200
parents fdef8b947c16
children 28050ad34088
files ChangeLog build-aux/pmccabe2html
diffstat 2 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-13  Simon Josefsson  <simon@josefsson.org>
+
+	* build-aux/pmccabe2html: Add css and css_url parameters.
+
 2008-10-12  Bruno Haible  <bruno@clisp.org>
 
 	* tests/test-sameacls.c (main) [AIX]: Clear type argument before
--- a/build-aux/pmccabe2html
+++ b/build-aux/pmccabe2html
@@ -21,15 +21,16 @@
 
 # Typical Invocation is from a Makefile.am:
 #
-# libidn-cyclo.html:
+# cyclo-libidn.html:
 #	$(PMCCABE) ${top_srcdir}/lib/*.[ch] \
 #		| sort -nr \
 #		| $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \
 #			-v lang=html -v name="$(PACKAGE_NAME)" \
 #			-v vcurl="http://git.savannah.gnu.org/gitweb/?p=libidn.git;a=blob;f=%FILENAME%;hb=HEAD" \
 #			-v url="http://www.gnu.org/software/libidn/" \
+#                       -v css=../../build-aux/pmccabe.css \
 #			> tmp
-#	mv tmp libidn-cyclo.html
+#	mv tmp $@
 #
 # The variables available are:
 #   lang     output language, either 'html' or 'wiki'
@@ -38,6 +39,8 @@
 #   vcurl    URL to version controlled source code browser,
 #            a %FILENAME% in the string is replaced with the relative
 #            source filename
+#   css      CSS stylesheet filename, included verbatim in HTML output
+#   css_url  link to CSS stylesheet, an URL
 
 # Prologue & configuration
 BEGIN {
@@ -62,7 +65,6 @@
     }
     html_epilog = "<hr color=\"black\" size=\"2\"/> \
 Copyright (c) 2007, 2008 Free Software Foundation Inc."
-    css_url = "pmccabe.css"
     html_doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \
 \"http://www.w3.org/TR/html401/loose.dtd\">"
     html_comment = "<!-- Generated by gnulib's pmccabe2html at " systime() " -->"
@@ -199,6 +201,18 @@
     {
         print "<link rel=\"stylesheet\" href=\"" css_url "\" type =\"text/css\" media=\"screen\"/>"
     }
+    if (css != "")
+    {
+        print "<style type =\"text/css\" media=\"screen\">"
+	print "<!--"
+        while ((getline cssline < css) > 0)
+        {
+	    print cssline
+	}
+        print "-->"
+	print "</style />"
+	close(css)
+    }
     print "</head>"
     print "<body lang=\"en\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" \
 vlink=\"#800080\" alink=\"#FF0000\">"