From 5468e76a7eb6a910b095bf065bc70cdf244c0a1c Mon Sep 17 00:00:00 2001 From: fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> Date: Thu, 28 Dec 2006 06:40:21 +0000 Subject: [PATCH] Added "Demos" page to the website. git-svn-id: https://pandoc.googlecode.com/svn/trunk@298 788f1e2b-df1e-0410-8736-df70ead52e1b --- Makefile | 6 +++++- web/S5DEMO | 19 +++++++++++++++++++ web/demos.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ web/header.html | 9 +++++---- 4 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 web/S5DEMO create mode 100644 web/demos.sh diff --git a/Makefile b/Makefile index e6e87cea2..f0077413b 100644 --- a/Makefile +++ b/Makefile @@ -344,7 +344,7 @@ make_page:=./$(MAIN) -s -B $(web_src)/header.html \ -H $(web_src)/css cleanup_files+=$(web_dest) website: $(web_dest) -$(web_dest)/: $(MAIN) html +$(web_dest)/: $(MAIN) html -rm -rf $(web_dest) ( \ mkdir $(web_dest); \ @@ -363,6 +363,10 @@ $(web_dest)/: $(MAIN) html sed -e 's/@WINDOWS_PKG_NAME@/$(win_pkg_name)/g' | \ sed -e 's/@VERSION@/$(VERSION)/g' | \ $(make_page) > $(web_dest)/index.html; \ + cp README $(web_dest)/README; \ + cp $(web_src)/S5DEMO $(web_dest)/S5DEMO; \ + sh $(web_src)/demos.sh $(web_dest) | \ + $(make_page) > $(web_dest)/demos.html; \ ) || { rm -rf $(web_dest); exit 1; } .PHONY: distclean clean diff --git a/web/S5DEMO b/web/S5DEMO new file mode 100644 index 000000000..e61ecf853 --- /dev/null +++ b/web/S5DEMO @@ -0,0 +1,19 @@ +% Eating Habits +% John Doe +% March 22, 2005 + +# In the morning + +- Eat eggs +- Drink coffee + +# In the evening + +- Eat spaghetti +- Drink wine + +# Conclusion + +- And the answer is... +- $f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$ + diff --git a/web/demos.sh b/web/demos.sh new file mode 100644 index 000000000..3c402ead6 --- /dev/null +++ b/web/demos.sh @@ -0,0 +1,43 @@ +#!/bin/sh -e +# creates demo page for pandoc +# argument is the destination directory + +DEST=$1 + +NEWLINE=' +' +DEMOS='pandoc README -o demo0.html +pandoc -s -S README -o demo0.html +pandoc -s README -o demo0.tex +pandoc -s -w rst README -o demo0.txt +pandoc -s README -o demo0.rtf +pandoc -s -m -i -w s5 S5DEMO -o demo0.html +web2markdown http://www.gnu.org/software/make/ -o demo0.txt +markdown2pdf README -o demo0.pdf' + +oldifs=$IFS +IFS=$NEWLINE +set -- $DEMOS +IFS=$oldifs + +cd $DEST +PATH=../..:$PATH + +echo '% Pandoc demos + +To see the output created by each of the commands below, +click on the name of the output file: + +' +num=0 +for command in "$@"; do + num=$((num + 1)) + command=$(echo $command | sed -e "s/0/$num/") + firstpart=$(echo $command | sed -e 's/\(.*\) [^ ]* -o.*/\1/') + input=$(echo $command | sed -e 's/.* \([^ ]*\) -o.*/\1/') + output=$(echo $command | sed -e 's/.*-o \(.*\)/\1/') + echo "1. <code>$firstpart <a href=\""$input"\" title=\""View input file"\">$input</a> -o <a href=\""$output"\" title=\""View pandoc output"\">$output</a></code>" + result=$($command) # run the command and create output file + echo "Created $output." >&2 +done + diff --git a/web/header.html b/web/header.html index fbbe7ac15..ee5528c94 100644 --- a/web/header.html +++ b/web/header.html @@ -4,10 +4,11 @@ <div id="sidebar"> <ul> -<li><a href="index.html">Home</a></li> -<li><a href="README.html">README</a></li> -<li><a href="doc/index.html">API</a></li> -<li><a href="history.html">History</a></li> +<li><a href="index.html" title="Home page">Home</a></li> +<li><a href="README.html" title="Pandoc documentation">README</a></li> +<li><a href="demos.html" title="Pandoc demos">Demos</a></li> +<li><a href="doc/index.html" title="API documentation for Pandoc libraries">API</a></li> +<li><a href="history.html" title="Pandoc's changelog">History</a></li> </ul> </div> <div id="main" class="withleftmenu">