[mapserver-commits] r9038 - in trunk/docs: . _templates

svn at osgeo.org svn at osgeo.org
Sat May 23 17:16:49 EDT 2009


Author: gislars
Date: 2009-05-23 17:16:48 -0400 (Sat, 23 May 2009)
New Revision: 9038

Modified:
   trunk/docs/Makefile
   trunk/docs/_templates/layout.html
Log:
added new option in Makefile to build docs with links according to mapserver.org environment
and make layout.html aware of this option


Modified: trunk/docs/Makefile
===================================================================
--- trunk/docs/Makefile	2009-05-20 20:58:15 UTC (rev 9037)
+++ trunk/docs/Makefile	2009-05-23 21:16:48 UTC (rev 9038)
@@ -10,10 +10,16 @@
 PAPER         =
 LANGUAGES     = en de
 
+# On mapserver.org we need to write alternate links for the language switcher.
+# This is triggered by setting TARGET to 'mapserverorg'
+# Unsetting or every other value will cause the standard behaviour.
+#
+#TARGET        = mapserverorg
+
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees/$$lang $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . -A language=$$lang -D language=$$lang
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees/$$lang $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) -c . -A language=$$lang -D language=$$lang -A target=$TARGET
 
 .PHONY: help clean html web pickle htmlhelp latex changes linkcheck
 
@@ -24,6 +30,8 @@
 	@echo "  json      to make JSON files"
 	@echo "  htmlhelp  to make HTML files and a HTML help project"
 	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  all-pdf   to make PDF file"
+	@echo "  all-ps    to make PS file"
 	@echo "  changes   to make an overview over all changed/added/deprecated items"
 	@echo "  linkcheck to check all external links for integrity"
 
@@ -35,7 +43,6 @@
 	do \
 		mkdir -p $(BUILDDIR)/html/$$lang $(BUILDDIR)/doctrees/$$lang; \
 		$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $$lang $(BUILDDIR)/html/$$lang;\
-		cp -R _static $(BUILDDIR)/html/; \
 	done
 	@echo
 	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/<language>.";\

Modified: trunk/docs/_templates/layout.html
===================================================================
--- trunk/docs/_templates/layout.html	2009-05-20 20:58:15 UTC (rev 9037)
+++ trunk/docs/_templates/layout.html	2009-05-23 21:16:48 UTC (rev 9038)
@@ -27,10 +27,14 @@
       <img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" width="18px" height="13px"/>
     {%- else %}
 {# just a hack to keep the current url for English docs; they start at www.mapserver.org/ instead of www.mapserver.org/<lng> #}
-      {% if lng == 'en' %}
-      <a href="{{pathto("../../"+pagename)}}"><img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" /></a>
+      {% if target == 'mapserverorg' %}
+        {% if lng == 'en' %}
+        <a href="{{pathto("../../"+pagename)}}"><img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" /></a>
+        {% else %}
+        <a href="{{pathto("../../"+lng+"/"+pagename)}}"><img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" /></a>
+        {% endif %}
       {% else %}
-      <a href="{{pathto("../../"+lng+"/"+pagename)}}"><img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" /></a>
+        <a href="{{pathto("../../html/"+lng+"/"+pagename)}}"><img src="{{ pathto("_static/flagicons/"+lng+".png", 1) }}" alt="{{ lng }}" title="{{ lng }}" border="0" /></a>
       {% endif %}
     {%- endif %}
     {%- endfor %}



More information about the mapserver-commits mailing list