From 06ff1feea054f42909776528b73787afaac202f8 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 19 Feb 2007 04:47:12 +0000 Subject: Use 'highlight' to produce syntax-highlighted versions of xml, html, and tex demo pages (in website /examples/). Add links so that html files can be viewed as web pages (without syntax highlighting). git-svn-id: https://pandoc.googlecode.com/svn/trunk@543 788f1e2b-df1e-0410-8736-df70ead52e1b --- web/Makefile | 4 ++++ web/mkdemos.pl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/web/Makefile b/web/Makefile index b713a05fe..28450c95f 100644 --- a/web/Makefile +++ b/web/Makefile @@ -12,6 +12,10 @@ clean: examples.txt : $(PANDOC_DEPS) mkdemos.pl config.xsl S5DEMO README PATH=$(PANDOC_PATH):$$PATH ./mkdemos.pl demos $@ + perl -pi -e 's!(href="(main|(my)?header|footer|example\d+)\.(html|tex|xml|css))"!\1.html"!g' $@ + for file in $$(ls | egrep '(main|(my)?header|footer|example[0-9]+)\.(html|tex|xml|css)$$'); \ + do highlight -u utf-8 --style emacs $$file > $$file.html; \ + done %.html : %.txt $(PANDOC_DEPS) $(MAKEPAGE) $< > $@ diff --git a/web/mkdemos.pl b/web/mkdemos.pl index 02e5da2f6..a56a8dc06 100755 --- a/web/mkdemos.pl +++ b/web/mkdemos.pl @@ -21,7 +21,11 @@ while () { $line =~ s/ ([A-Za-z0-9_:\/]+(\.|\/)[a-zA-Z0-9.\/]*|README|S5DEMO)/ $1<\/a>/g; $line =~ s/-/\\-/g; $line =~ s/^(.*)$/ $1<\/code>/g; + if ( $line =~ /(example\d+\.html)<\/a><\/code>/m ) { + $line .= "\n (View [`$1` as a web page]($1).)\n"; + } } print OUT $line; } + -- cgit v1.2.3