From 31a956b65559ea669d5705e005ac3d6641d7518e Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 19 Dec 2006 22:00:41 +0000 Subject: Changes to build process relating to r234. + Corrected dependencies in Makefiles to ensure that templates get filled when the relevant files are modified. + Changed template placeholders to @xxx@ instead of , for consistency with our practice with the Cabal template. + Changed default font for RTF writer (this had been changed earlier, but in the target rather than the template!) git-svn-id: https://pandoc.googlecode.com/svn/trunk@235 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 5 ++--- src/headers/RTFHeader | 2 +- src/templates/ASCIIMathML.hs | 2 +- src/templates/DefaultHeaders.hs | 8 ++++---- src/templates/Makefile | 6 +++--- src/templates/S5.hs | 14 +++++++------- src/templates/fillTemplates.pl | 24 ++++++++++++------------ 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 369ee5e6f..2f45dce44 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,6 @@ all: build-program .PHONY: templates templates: $(SRCDIR)/templates -$(SRCDIR)/templates: $(MAKE) -C $(SRCDIR)/templates define generate-shell-script @@ -120,7 +119,7 @@ $(CABAL): cabalize $(CABAL).in $(SRCDIR)/Main.hs .PHONY: configure cleanup_files+=$(BUILDDIR) $(BUILDCONF) $(BUILDVARS) -configure: $(BUILDCONF) +configure: $(BUILDCONF) templates $(BUILDCONF): $(CABAL) $(BUILDCMD) configure --prefix=$(PREFIX) # Make configuration time settings persistent (definitely a hack). @@ -128,7 +127,7 @@ $(BUILDCONF): $(CABAL) @echo "DESTDIR?=$(DESTDIR)" >>$(BUILDVARS) .PHONY: build -build: templates configure +build: configure $(BUILDCMD) build .PHONY: build-exec diff --git a/src/headers/RTFHeader b/src/headers/RTFHeader index 62923c1d6..b4368694b 100644 --- a/src/headers/RTFHeader +++ b/src/headers/RTFHeader @@ -1,4 +1,4 @@ -{\rtf1\ansi\deff0{\fonttbl{\f0 Times New Roman;}{\f1 Courier;}} +{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}} {\colortbl;\red255\green0\blue0;\red0\green0\blue255;} \widowctrl\hyphauto diff --git a/src/templates/ASCIIMathML.hs b/src/templates/ASCIIMathML.hs index fabc7fba2..7747a52a2 100644 --- a/src/templates/ASCIIMathML.hs +++ b/src/templates/ASCIIMathML.hs @@ -4,4 +4,4 @@ module Text.Pandoc.ASCIIMathML ( asciiMathMLScript ) where -- | String containing Pandoc.ASCIIMathML javascript. asciiMathMLScript :: String -asciiMathMLScript = "\n" +asciiMathMLScript = "\n" diff --git a/src/templates/DefaultHeaders.hs b/src/templates/DefaultHeaders.hs index 22d17d6a7..4c552cea7 100644 --- a/src/templates/DefaultHeaders.hs +++ b/src/templates/DefaultHeaders.hs @@ -8,13 +8,13 @@ module Text.Pandoc.Writers.DefaultHeaders ( import Text.Pandoc.Writers.S5 defaultLaTeXHeader :: String -defaultLaTeXHeader = "" +defaultLaTeXHeader = "@LaTeXHeader@" defaultHtmlHeader :: String -defaultHtmlHeader = "" +defaultHtmlHeader = "@HtmlHeader@" defaultS5Header :: String -defaultS5Header = "" ++ s5CSS ++ s5Javascript +defaultS5Header = "@S5Header@" ++ s5CSS ++ s5Javascript defaultRTFHeader :: String -defaultRTFHeader = "" +defaultRTFHeader = "@RTFHeader@" diff --git a/src/templates/Makefile b/src/templates/Makefile index ccd7b7076..c3256b87e 100644 --- a/src/templates/Makefile +++ b/src/templates/Makefile @@ -6,11 +6,11 @@ TARGETS := Text/Pandoc/ASCIIMathML.hs \ all: $(TARGETS) -Text/Pandoc/ASCIIMathML.hs: ASCIIMathML.hs $(PROCESSOR) $(VPATH)/ASCIIMathML.js +Text/Pandoc/ASCIIMathML.hs: ASCIIMathML.hs $(PROCESSOR) $(VPATH)/ASCIIMathML.js perl $(PROCESSOR) $@ $(VPATH) -Text/Pandoc/Writers/S5.hs: S5.hs $(PROCESSOR) $(VPATH)/headers/* +Text/Pandoc/Writers/S5.hs: S5.hs $(PROCESSOR) $(VPATH)/ui/default/* perl $(PROCESSOR) $@ $(VPATH) -Text/Pandoc/Writers/DefaultHeaders.hs: DefaultHeaders.hs $(PROCESSOR) $(VPATH)/ui/default/* +Text/Pandoc/Writers/DefaultHeaders.hs: DefaultHeaders.hs $(PROCESSOR) $(VPATH)/headers/* perl $(PROCESSOR) $@ $(VPATH) diff --git a/src/templates/S5.hs b/src/templates/S5.hs index 1417e7d7d..537286040 100644 --- a/src/templates/S5.hs +++ b/src/templates/S5.hs @@ -14,25 +14,25 @@ import Text.Pandoc.Writers.HTML ( writeHtml ) import Text.Pandoc.Definition s5Javascript :: String -s5Javascript = "\n" +s5Javascript = "\n" s5CoreCSS :: String -s5CoreCSS = "" +s5CoreCSS = "@s5-core.css@" s5FramingCSS :: String -s5FramingCSS = "" +s5FramingCSS = "@framing.css@" s5PrettyCSS :: String -s5PrettyCSS = "" +s5PrettyCSS = "@pretty.css@" s5OperaCSS :: String -s5OperaCSS = "" +s5OperaCSS = "@opera.css@" s5OutlineCSS :: String -s5OutlineCSS = "" +s5OutlineCSS = "@outline.css@" s5PrintCSS :: String -s5PrintCSS = "" +s5PrintCSS = "@print.css@" s5CSS :: String s5CSS = "\n\n\n\n" diff --git a/src/templates/fillTemplates.pl b/src/templates/fillTemplates.pl index e85f1672a..037aea659 100644 --- a/src/templates/fillTemplates.pl +++ b/src/templates/fillTemplates.pl @@ -45,13 +45,13 @@ my %processor = ( my $outline = escape_for_haskell(slurp "ui/default/outline.css"); my $print = escape_for_haskell(slurp "ui/default/print.css"); - $template =~ s//$slides/; - $template =~ s//$s5core/; - $template =~ s//$framing/; - $template =~ s//$pretty/; - $template =~ s//$opera/; - $template =~ s//$outline/; - $template =~ s//$print/; + $template =~ s/\@slides\.js@/$slides/; + $template =~ s/\@s5-core\.css@/$s5core/; + $template =~ s/\@framing\.css@/$framing/; + $template =~ s/\@pretty\.css@/$pretty/; + $template =~ s/\@opera\.css@/$opera/; + $template =~ s/\@outline\.css@/$outline/; + $template =~ s/\@print\.css@/$print/; return $template; }, @@ -68,7 +68,7 @@ my %processor = ( " released under the GPL\\nSee ". "http://www1.chapman.edu/~jipsen/mathml/asciimath.html/ "; $script =~ s/\/\*.*?\*\//\/\*$acknowledgements\*\//g; # strip comments - $template =~ s//$script/; + $template =~ s/\@ASCIIMathML\.js@/$script/; return $template; }, @@ -84,10 +84,10 @@ my %processor = ( my $rtf = escape_for_haskell(slurp "headers/RTFHeader"); my $s5 = escape_for_haskell(slurp "headers/S5Header"); - $template =~ s//$html/; - $template =~ s//$latex/; - $template =~ s//$rtf/; - $template =~ s//$s5/; + $template =~ s/\@HtmlHeader@/$html/; + $template =~ s/\@LaTeXHeader@/$latex/; + $template =~ s/\@RTFHeader@/$rtf/; + $template =~ s/\@S5Header@/$s5/; return $template; }, -- cgit v1.2.3