From 133f179166af58b2d179045f7e70a1cc0dda40cc Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 15 Dec 2010 11:04:37 +0100
Subject: [PATCH] Update hscolour usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch fixes two issues related to coloured sources generation.
First, recent hscolour has changed the css file (and we need to update
it), but it also can output it at runtime, so there's no need to store
it anymore in the source tree.

Second, the current source generation predates the addition of sources
in Ganeti/ (as opposed to just Ganeti/HTools), and thus we were missing
the sources in that directory. We replace the target file name to
account for different base directories.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 Makefile     | 7 ++++---
 hscolour.css | 6 ------
 2 files changed, 4 insertions(+), 9 deletions(-)
 delete mode 100644 hscolour.css

diff --git a/Makefile b/Makefile
index 3ce286177..ddda3b44e 100644
--- a/Makefile
+++ b/Makefile
@@ -39,10 +39,11 @@ $(DOCS) : %.html : %
 doc: $(DOCS) Ganeti/HTools/Version.hs
 	rm -rf $(HDDIR)/*
 	mkdir -p $(HDDIR)/Ganeti/HTools
-	cp hscolour.css $(HDDIR)/Ganeti/HTools
+	HsColour -print-css > $(HDDIR)/Ganeti/hscolour.css
+	ln -s ../hscolour.css $(HDDIR)/Ganeti/HTools/hscolour.css
 	for file in $(HSRCS); do \
-		HsColour -css -anchor \
-		$$file > $(HDDIR)/Ganeti/HTools/`basename $$file .hs`.html ; \
+		hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
+		HsColour -css -anchor $$file > $(HDDIR)/$$hfile ; \
 	done
 	haddock --odir $(HDDIR) --html --ignore-all-exports \
 		-t ganeti-htools -p haddock-prologue \
diff --git a/hscolour.css b/hscolour.css
deleted file mode 100644
index b0dc6e915..000000000
--- a/hscolour.css
+++ /dev/null
@@ -1,6 +0,0 @@
-
-.keyglyph, .layout {color: red;}
-.keyword {color: blue;}
-.comment, .comment a {color: green;}
-.str, .chr {color: teal;}
-.keyword,.conid, .varid, .conop, .varop, .num, .cpp, .sel, .definition {}
-- 
GitLab