Added "Demos" page to the website.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@298 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2006-12-28 06:40:21 +00:00
parent a1a30d69bd
commit 5468e76a7e
4 changed files with 72 additions and 5 deletions

View file

@ -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

19
web/S5DEMO Normal file
View file

@ -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$

43
web/demos.sh Normal file
View file

@ -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

View file

@ -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">