Anonymous avatar Anonymous committed 84629ae

Adjust build system and web site structure.

Comments (0)

Files changed (3)

 include Makefile.vars
 
-# Makefile.vars include the following system-dependent variables:
+# Makefile.vars includes the following system-dependent variables:
 #
 # dtd-url = the location of the DocBook 4.5 DTD on your filesystem
 # system-xsl-dir = the location of DocBook XSLT on your filesystem
+# dynamic-link-command = the command to link the DocBook XSLT to our styles 
 # python = the location of Python 3.x on your filesystem
 
 xml-src-files := \
 
 xsltproc-opts := --nonet --xinclude
 xmllint-opts := --noout --nonet --valid --path '$(dtd-url)'
-    
-obj-web := html
+
+root-web := html
+support-web := $(root-web)/support
+obj-web := $(root-web)/read
 figs-web-folder := $(obj-web)/figs
 script-web := $(obj-web)/javascript
 web-global := ../web
 web-local := web
 
-html: $(obj-web)/index.html $(web-local)/index-read.html.in
+html: $(obj-web)/index.html $(web-local)/index-read.html.in figs
 
-#$(obj-web)/index.html: ../stylesheets/system-xsl .validated-00book.xml #../web/index-read.html.in
-$(obj-web)/index.html: .validated-00book.xml
+$(obj-web)/index.html: ../stylesheets/system-xsl .validated-00book.xml
 	xsltproc $(xsltproc-opts) -o $(obj-web)/x ../stylesheets/it/web.xsl 00book.xml
-#	xsltproc $(xsltproc-opts) -o $(obj-web)/x ../stylesheets/chunk-stylesheet.xsl 00book.xml
-	cp $(web-global)/styles.css $(obj-web)
+	mkdir -p $(support-web)
+	cp -f $(web-global)/icons/*.png $(support-web)
+	cp $(web-global)/styles.css $(support-web)
+	sed -i -e "s|figs/||g" $(support-web)/styles.css
 	mkdir -p $(figs-web-folder)
-	cp -f $(web-global)/icons/*.png $(figs-web-folder)
-	cp -f examples/figs/*.png $(figs-web-folder)
 	mkdir -p $(script-web)
 	cp -f $(web-local)/*.js $(script-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; \
-#	done
 
-#../stylesheets/system-xsl: $(system-xsl-dir)
-#	ln -s $< $@
+../stylesheets/system-xsl: $(system-xsl-dir)
+	$(dynamic-link-command)
 
 $(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
+	sed -i -e "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-read.html.in)|g" $(obj-web)/index.html
+	sed -i -e "s|/support/|../support/|g" $(obj-web)/*.html
+	cp $(web-local)/index-template.html $(root-web)/index.html
+	sed -i "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-home.html.in)|g" $(root-web)/index.html
+	sed -i -e "s|/support/|support/|g" $(root-web)/index.html
 
 $(web-local)/genindex.py: $(xml-src-files)
 	cd $(web-local) && $(python) genindex.py
 
 valid: .validated-00book.xml
 
-.validated-00book.xml: $(xml-src-files) #examples/.run
+.validated-00book.xml: $(xml-src-files)
 	xmllint $(xmllint-opts) $<
 	touch $@
 
 clean:
 	rm -f $(web-local)/index-read.html.in
-	rm -rf $(obj-web)
+	rm -f .validated-00book.xml
+	rm -rf $(root-web)
 
 image-folder := figs
 # graphs, figures, screenshots
 # screenshots
 image-png := $(filter %.png, $(image-files))
 
-# this must already exists
-figs-folder := examples/figs
 figs-web := \
-	$(image-dot:$(image-folder)/%.dot=$(figs-folder)/%.png) \
-	$(image-svg:$(image-folder)/%.svg=$(figs-folder)/%.png) \
-	$(image-png:$(image-folder)/%.png=$(figs-folder)/%.png)
+	$(image-dot:$(image-folder)/%.dot=$(figs-web-folder)/%.png) \
+	$(image-svg:$(image-folder)/%.svg=$(figs-web-folder)/%.png) \
+	$(image-png:$(image-folder)/%.png=$(figs-web-folder)/%.png)
 
 figs: $(figs-web)
 
-$(figs-folder)/%.png: $(image-folder)/%.svg
+$(figs-web-folder)/%.png: $(image-folder)/%.svg
 	inkscape -D -d 120 -e $@ $<
 
-$(figs-folder)/%.png: $(figs-folder)/%.svg
+$(figs-web-folder)/%.png: $(figs-web-folder)/%.svg
 	inkscape -D -e $@ $<
 	rm $<
 
-$(figs-folder)/%.png: $(image-folder)/%.png
+$(figs-web-folder)/%.png: $(image-folder)/%.png
 	cp $< $@
 
-$(figs-folder)/%.svg: $(image-folder)/%.dot
+$(figs-web-folder)/%.svg: $(image-folder)/%.dot
 	dot -Tsvg -o $@ $<

it/web/index-template.html

   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     <title>Mercurial: la guida definitiva</title>
-    <link rel="stylesheet" href="styles.css" type="text/css"/>
+    <link rel="stylesheet" href="/support/styles.css" type="text/css"/>
     <!--
     <link rel="alternate" type="application/atom+xml" title="Comments"
       href="/feeds/comments/"/>
     -->
-    <link rel="shortcut icon" type="image/png" href="figs/favicon.png"/>
+    <link rel="shortcut icon" type="image/png" href="/support/favicon.png"/>
     <!-- No comment system for italian translation
     <script type="text/javascript" src="/support/jquery.js"></script>
       <script type="text/javascript" src="/support/form.js"></script>
   <body>
     {% block bodycontent %}{% endblock %}
 
-    <div class="hgbookfooter"> <p><img src="figs/rss.png"> Volete rimanere aggiornati? Abbonatevi al feed del <a class="feed" href="http://bitbucket.org/gpiancastelli/hgbook-it/atom">libro italiano</a>.</p> <p>Copyright 2006, 2007, 2008, 2009 Bryan O&#8217;Sullivan. Icone realizzate da <a href="mailto:mattahan@gmail.com">Paul Davey</a> alias <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p> <p>Copyright 2009 <a href="mailto:giulio.piancastelli@gmail.com">Giulio Piancastelli</a> per la traduzione italiana.</p>
+    <div class="hgbookfooter"> <p><img src="/support/rss.png"> Volete rimanere aggiornati? Abbonatevi al feed del <a class="feed" href="http://bitbucket.org/gpiancastelli/hgbook-it/atom">libro italiano</a>.</p> <p>Copyright 2006, 2007, 2008, 2009 Bryan O&#8217;Sullivan. Icone realizzate da <a href="mailto:mattahan@gmail.com">Paul Davey</a> alias <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p> <p>Copyright 2009 <a href="mailto:giulio.piancastelli@gmail.com">Giulio Piancastelli</a> per la traduzione italiana.</p>
     </div>
 
     <!-- Also, no need for Google Analytics on the italian translation

stylesheets/it/web.xsl

   <xsl:import href="../chunk-stylesheet.xsl"/>
 
   <xsl:param name="l10n.gentext.language" select="'it'"/>
-  
-  <xsl:param name="html.stylesheet">styles.css</xsl:param>
+  <xsl:param name="admon.graphics.path">/support/</xsl:param>
   
   <xsl:template name="user.head.content">
     <!--
     <link rel="alternate" type="application/atom+xml" title="Comments"
       href="/feeds/comments/"/>
     -->
-    <link rel="shortcut icon" type="image/png" href="figs/favicon.png"/>
+    <link rel="shortcut icon" type="image/png" href="/support/favicon.png"/>
     <script type="text/javascript" src="javascript/jquery-min.js"></script>
     <script type="text/javascript" src="javascript/hgbook.js"></script>
   </xsl:template>
   
   <xsl:template name="user.footer.content">
     <div class="hgfooter">
-      <p><img src="figs/rss.png"/> Volete rimanere aggiornati? Abbonatevi al feed delle modifiche per il <a class="feed" href="http://bitbucket.org/gpiancastelli/hgbook-it/atom">libro italiano</a>.</p>
+      <p><img src="/support/rss.png"/> Volete rimanere aggiornati? Abbonatevi al feed delle modifiche per il <a class="feed" href="http://bitbucket.org/gpiancastelli/hgbook-it/atom">libro italiano</a>.</p>
       <p>Copyright 2006, 2007, 2008, 2009 Bryan O&#8217;Sullivan.
       Icone realizzate da <a href="mailto:mattahan@gmail.com">Paul Davey</a> alias <a href="http://mattahan.deviantart.com/">Mattahan</a>.</p>
       <p>Copyright 2009 <a href="mailto:giulio.piancastelli@gmail.com">Giulio Piancastelli</a> per la traduzione italiana.</p>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.