Workflow for producing Tutorial

Uses Ubuntu package docbook-xsl 1.75.2+dfsg-3
Base dir doc/tutorial

1)
Create one Docbook file per language (en,fr,de,it) (filter stylesheet from http://docbooksml.sourceforge.net/)

xsltproc --stringparam language {lang} --output tutorial_{lang}.xml xsl/filter_language.xsl tutorial.xml

2)
Create html output assuming that gh-pages branch is checked.out into a folder MyExpenses.pages
parallel to the project root

xsltproc --stringparam base.dir ../../../MyExpenses.pages/tutorial/{lang}/ xsl/tutorial.xsl tutorial_{lang}.xml

1 and 2 now executed through ant target tutorial

3) Screenshots

Screenshots are created with a monkeyrunner script with a Google Nexus S with 
resolution 480 x 800. The script writes them into
MyExpenses.pages/tutorial/{lang}/large. Before each run, the interface language 
should be set to the language given as parameter for the run and THEN a fresh install
should be done.
The script makes use of a helping trick that must first be commented out in the following 
JAVA files ExpenseEdit, AccountEdit, MyExpenses and SelectCategory.
It sends a special KEYCODE that fills out the form with testing
data, or sets the focus. Doing both with Monkeyrunners functions prooved to be unreliable. 
The commenting out can be done by applying the following patch
patch -p1 <doc/tutorial/mk_backdoor.diff
 

#comment out onKeyUp handlers
#IMPORTANT: Android standard keyboard must be used,
ant debug
adb uninstall org.totschnig.myexpenses
adb install bin/MyExpenses-debug.apk
#now language must be set, app started by hand, and the help dialog closed.
cd doc/tutorial
monkeyrunner mk_screenshots.py {lang}


The smaller images are created with the following shell command
executed from MyExpenses.pages 
screenshots
for lang in en fr de it es
  do (
    cd ${lang}/tutorial_r4/large
    pwd
    for i in *.png
      do
        base=${i%.png}
        convert ${i} -resize 40%  ${base}_klein.png
        pngnq ${base}_klein.png
        mv ${base}_klein-nq8.png ../${i}
        rm ${base}_klein.png
      done
    )
  done

