[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pmccabe2html: support inline stylesheets
From: |
Simon Josefsson |
Subject: |
pmccabe2html: support inline stylesheets |
Date: |
Mon, 13 Oct 2008 12:22:43 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) |
Pushed.
Jose, after this patch you'll need to supply a new parameter
css=filename or css_url=url to provide the stylesheet. Do you think
this approach is good? I dislike hard coded parameters like the current
pmccabe.css filename.
/Simon
>From b13005f4bf9ed08072874318e2b377851a70263a Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Mon, 13 Oct 2008 12:20:30 +0200
Subject: [PATCH] pmccabe2html: Add css and css_url parameters.
---
ChangeLog | 4 ++++
build-aux/pmccabe2html | 20 +++++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 856ca31..3aa6dab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-13 Simon Josefsson <address@hidden>
+
+ * build-aux/pmccabe2html: Add css and css_url parameters.
+
2008-10-12 Bruno Haible <address@hidden>
* tests/test-sameacls.c (main) [AIX]: Clear type argument before
diff --git a/build-aux/pmccabe2html b/build-aux/pmccabe2html
index 03e697b..fc47258 100755
--- 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 @@ BEGIN {
}
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 @@ function html_header ()
{
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\">"
--
1.5.6.5
- pmccabe2html: support inline stylesheets,
Simon Josefsson <=