# HG changeset patch # User Giulio@puck # Date 1244494755 -7200 # Node ID 96c0123423558d180d50ef287e4051df0a136df0 # Parent 716f76ea4a34c9862398036e7c2d1b210fb6f13b More makefile, plus main index template and generator script. diff -r 716f76ea4a34 -r 96c012342355 .hgignore --- a/.hgignore Mon Jun 08 18:34:23 2009 +0200 +++ b/.hgignore Mon Jun 08 22:59:15 2009 +0200 @@ -24,6 +24,7 @@ en/examples/results en/html en/svn +it/html stylesheets/system-xsl tools web/hgbook/.database.sqlite3 diff -r 716f76ea4a34 -r 96c012342355 it/Makefile --- a/it/Makefile Mon Jun 08 18:34:23 2009 +0200 +++ b/it/Makefile Mon Jun 08 22:59:15 2009 +0200 @@ -2,16 +2,24 @@ xml-src-files := \ 00book.xml \ - #app*.xml \ - ch*.xml + $(wildcard ch*.xml) + #$(wildcard app*.xml) + obj-web := html +figs-web := ${obj-web}/figs +web-global := ../web +web-local := web -html: ${obj-web}/index.html +html: ${obj-web}/index.html ${web-local}/index-read.html.in #$(obj-web)/index.html: ../stylesheets/system-xsl .validated-00book.xml #../web/index-read.html.in $(obj-web)/index.html: .validated-00book.xml xsltproc $(xsltproc-opts) -o $(obj-web)/x ../stylesheets/chunk-stylesheet.xsl 00book.xml + cp ${web-global}/styles.css ${obj-web} + mkdir -p ${figs-web} + cp -f ${web-global}/icons/*.png $(figs-web) + sed -i -e "s|/support/||g" ${obj-web}/*.html # python ../web/texpand.py ../web/index-read.html.in html/read/index.html # for i in $(obj-web-read)/*.html; do \ # gzip -9 -c $$i > $$i.gz; \ @@ -20,9 +28,19 @@ #../stylesheets/system-xsl: $(system-xsl-dir) # ln -s $< $@ +$(web-local)/index-read.html.in: $(web-local)/genindex.py $(xml-src-files) + cp $(web-local)/index-template.html $(obj-web)/index.html + sed -i -e "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-read.html.in)|g" ${obj-web}/index.html + +$(web-local)/genindex.py: $(xml-src-files) + cd $(web-local) && ./genindex.py + valid: .validated-00book.xml .validated-00book.xml: $(xml-src-files) #examples/.run xmllint $(xmllint-opts) $< touch $@ +clean: + rm -f $(web-local)/index-read.html.in + rm -rf $(obj-web) diff -r 716f76ea4a34 -r 96c012342355 it/web/genindex.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/it/web/genindex.py Mon Jun 08 22:59:15 2009 +0200 @@ -0,0 +1,58 @@ +#!C:/Programmi/Python30/python + +import glob, os, re + +chapter_re = re.compile(r'<(chapter|appendix|preface)\s+id="([^"]+)">') +filename_re = re.compile(r'<\?dbhtml filename="([^"]+)"\?>') +title_re = re.compile(r'(.*)') + +chapters = (sorted(glob.glob('../ch*.xml')) + + sorted(glob.glob('../app*.xml'))) + +fp = open('index-read.html.in', 'w') + +print(''' + +
', file=fp) + +fp.close() diff -r 716f76ea4a34 -r 96c012342355 it/web/index-template.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/it/web/index-template.html Mon Jun 08 22:59:15 2009 +0200 @@ -0,0 +1,36 @@ + + + + Mercurial: la guida definitiva + + + + + + + + {% block bodycontent %}{% endblock %} + +

Volete rimanere aggiornati? Abbonatevi al feed delle modifiche per qualsiasi capitolo o per l'intero libro.

Copyright 2006, 2007, 2008, 2009 Bryan O'Sullivan. Icone realizzate da Paul Davey alias Mattahan.

+
+ + + +