DESTDIR = /projects/mowgli/public_html
#DESTDIR = /tmp/mowgli
+#HTMLDESTDIRSUFFIX = html_frames
+#HTMLDESTDIRSUFFIX = html_no_frames
+HTMLDESTDIRSUFFIX = html
+
+HTMLDESTDIR = $(DESTDIR)/$(HTMLDESTDIRSUFFIX)
+
XSLTP = xsltproc --param current-date "'`date`'"
TEMPLATESROOT = ../templates
XMLROOT = ../xml
RMDOCTYPE = "s/<\\!DOCTYPE[^>]*>//"
-ifeq ($(FRAMES),yes)
- XHTMLCONTENT = $(XSLROOT)/xhtml-content.xsl
-else
- XHTMLCONTENT = $(XSLROOT)/xhtml-content-no-frames.xsl
-endif
+XHTMLCONTENT = $(XSLROOT)/xhtml-content.xsl
PEOPLE = \
people/aei/kelley.html \
$(XHTMLCONTENT)
$(XSLTP) -o latest-news.xml $(XSLROOT)/latest-news.xsl $(XMLROOT)/news.xml
$(XSLTP) --param today `date +%Y%m%d` -o approaching-deadlines.xml $(XSLROOT)/approaching-deadlines.xsl $(XMLROOT)/other-events.xml
- $(XSLTP) --param make_header "false()" --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) $(XMLROOT)/home.xml
+ $(XSLTP) --param make_header "false()" --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) $(XMLROOT)/home.xml
ifeq ($(FRAMES),yes)
index.html: $(TEMPLATESROOT)/index.html
cp $< $@
#Same stuff as for home.html... but with a different path_to_top
dot_dot_index.html: home.html
- $(XSLTP) --param make_header "false()" --param path_to_top "'html'" -o $@ $(XHTMLCONTENT) $(XMLROOT)/home.xml
+ $(XSLTP) --param make_header "false()" --param path_to_top "'html'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) $(XMLROOT)/home.xml
endif
members/ml-help-example.txt: $(TEMPLATESROOT)/ml-help-example.txt
members/index.html: $(XMLROOT)/members-index.xml \
$(XHTMLCONTENT)
- sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
software/index.html: $(XMLROOT)/software/index.xml \
$(XHTMLCONTENT)
- $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) $<
+ $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) $<
menu.html: $(TEMPLATESROOT)/menu.html
cp $< $@
project-management.html: $(XMLROOT)/project-management.xml \
$(XHTMLCONTENT)
- sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
project-summary.html: $(XMLROOT)/project-summary.xml \
$(XHTMLCONTENT)
- sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
project-objectives.html: $(XMLROOT)/project-objectives.xml \
$(XHTMLCONTENT)
- sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
mowgli-events/kick-off.html: $(XMLROOT)/mowgli-events/kick-off.xml \
$(XHTMLCONTENT)
- sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ sed $(RMDOCTYPE) $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
people-list.html: $(XMLROOT)/people/index.xml \
$(XSLROOT)/people-list.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/people-list.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/people-list.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
consortium.html: $(XMLROOT)/consortium.xml \
$(XSLROOT)/consortium.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/consortium.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/consortium.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
project.html: $(XMLROOT)/project.xml \
$(XSLROOT)/project.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/project.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/project.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
news.html: $(XMLROOT)/news.xml \
$(XSLROOT)/news.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/news.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/news.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
other-events.html: $(XMLROOT)/other-events.xml \
$(XSLROOT)/events.xsl \
$(XHTMLCONTENT)
- $(XSLTP) --param today `date +%Y%m%d` --param events-class "'Other'" $(XSLROOT)/events.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) --param today `date +%Y%m%d` --param events-class "'Other'" $(XSLROOT)/events.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
mowgli-events.html: $(XMLROOT)/mowgli-events.xml \
$(XSLROOT)/events.xsl \
$(XHTMLCONTENT)
- $(XSLTP) --param today `date +%Y%m%d` --param events-class "'MOWGLI'" $(XSLROOT)/events.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) --param today `date +%Y%m%d` --param events-class "'MOWGLI'" $(XSLROOT)/events.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
deadlines.html: $(XMLROOT)/other-events.xml \
$(XSLROOT)/deadlines.xsl \
$(XHTMLCONTENT)
- $(XSLTP) --param today `date +%Y%m%d` --param events-class "'Other'" $(XSLROOT)/deadlines.xsl $< | $(XSLTP) --param path_to_top "'.'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) --param today `date +%Y%m%d` --param events-class "'Other'" $(XSLROOT)/deadlines.xsl $< | $(XSLTP) --param path_to_top "'.'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
deliverables/%.html: $(XMLROOT)/deliverables/%.xml \
$(XSLROOT)/deliverable.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/deliverable.xsl $< | $(XSLTP) --param path_to_top "'../..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/deliverable.xsl $< | $(XSLTP) --param path_to_top "'../..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
sites/%.html: $(XMLROOT)/sites/%.xml \
$(XSLROOT)/site.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/site.xsl $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/site.xsl $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
people/%.html: $(XMLROOT)/people/%.xml \
$(XSLROOT)/person.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/person.xsl $< | $(XSLTP) --param path_to_top "'../..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/person.xsl $< | $(XSLTP) --param path_to_top "'../..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
publications/index.html: $(XMLROOT)/publications/index.xml \
$(XSLROOT)/publications-index.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/publications-index.xsl $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/publications-index.xsl $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
publications/%.html: $(XMLROOT)/publications/%.xml \
$(XSLROOT)/publication.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/publication.xsl $< | $(XSLTP) --param path_to_top "'../..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/publication.xsl $< | $(XSLTP) --param path_to_top "'../..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
work-packages/index.html: $(XMLROOT)/work-packages/index.xml \
$(XSLROOT)/work-packages_index.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/work-packages_index.xsl $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/work-packages_index.xsl $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
work-packages/%.html: $(XMLROOT)/work-packages/%.xml \
$(XSLROOT)/work-package.xsl \
$(XHTMLCONTENT)
- $(XSLTP) $(XSLROOT)/work-package.xsl $< | $(XSLTP) --param path_to_top "'..'" -o $@ $(XHTMLCONTENT) -
+ $(XSLTP) $(XSLROOT)/work-package.xsl $< | $(XSLTP) --param path_to_top "'..'" --param use_frames "'$(FRAMES)'" -o $@ $(XHTMLCONTENT) -
clean:
.PHONY: clean
install: $(DOCUMENTS)
- mkdir -p $(DESTDIR)/html
+ mkdir -p $(HTMLDESTDIR)
for i in $(dir $(DOCUMENTS)); do \
- mkdir -p $(DESTDIR)/html/$$i; \
+ mkdir -p $(HTMLDESTDIR)/$$i; \
done
for i in $(DOCUMENTS); do \
- cp $$i $(DESTDIR)/html/$$i; \
+ cp $$i $(HTMLDESTDIR)/$$i; \
done
mkdir -p $(DESTDIR)/images
cp ../images/*.* $(DESTDIR)/images
mkdir -p $(DESTDIR)/style
cp ../style/*.css $(DESTDIR)/style
- cp ../htaccess $(DESTDIR)/html/members/.htaccess
- mkdir -p $(DESTDIR)/html/members/contract
- cp ../misc/contract/*.* $(DESTDIR)/html/members/contract
- if [ -f dot_dot_index.html ] ; then cp dot_dot_index.html $(DESTDIR)/index.html ; else sed s/menu\\.html/html\\/menu\\.html/ <index.html | sed s/home\\.html/html\\/home\\.html/ >$(DESTDIR)/index.html ; fi
+ cp ../htaccess $(HTMLDESTDIR)/members/.htaccess
+ mkdir -p $(DESTDIR)/misc/contract
+ cp ../htaccess $(DESTDIR)/misc/contract/.htaccess
+ cp ../misc/contract/*.* $(DESTDIR)/misc/contract
+ if [ -f dot_dot_index.html ] ; then cp dot_dot_index.html $(DESTDIR)/index.html ; else sed s/menu\\.html/$(HTMLDESTDIRSUFFIX)\\/menu\\.html/ <index.html | sed s/home\\.html/$(HTMLDESTDIRSUFFIX)\\/home\\.html/ >$(DESTDIR)/index.html ; fi
uninstall:
rm -rf $(DESTDIR)/*
<xsl:param name="path_to_top" select="'.'"/>
<xsl:param name="current-date"/>
<xsl:param name="make_header" select="true()"/>
+<xsl:param name="use_frames" select="'yes'"/>
<!--CSC: The following mess is due to a bug of xsltproc w.r.t. patterns
precedence: the less general pattern is sometimes applied ;-( -->
<link rel="stylesheet" href="{$path_to_top}/../style/mowgli.css" type="text/css"/>
</head>
<body>
+ <xsl:variable name="body">
<xsl:if test="$make_header">
<xsl:call-template name="head">
<xsl:with-param name="path_to_top" select="$path_to_top"/>
<xsl:call-template name="foot">
<xsl:with-param name="path_to_top" select="$path_to_top"/>
</xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$use_frames = 'yes'">
+ <xsl:copy-of select="$body"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <table>
+ <tr>
+ <td nowrap="true" valign="top">
+ <xsl:apply-templates mode="menu" select="document('../templates/menu.xml')/*/*[2]/*"/>
+ </td>
+ <td width="5%"> </td>
+ <td valign="top">
+ <xsl:copy-of select="$body"/>
+ </td>
+ </tr>
+ </table>
+ </xsl:otherwise>
+ </xsl:choose>
</body>
</html>
</xsl:template>
<xsl:template match="mowgli:date">
<xsl:copy-of select="$current-date"/>
</xsl:template>
+
+<xsl:template name="a_menu">
+ <xsl:copy>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href,'/') or
+ starts-with(@href,'http://') or
+ starts-with(@href,'mailto:')">
+ <xsl:copy-of select="@href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="href">
+ <xsl:value-of select="$path_to_top"/>
+ <xsl:text>/</xsl:text>
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:value-of select="text()"/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template mode="menu" match="*|text()|@*">
+ <xsl:choose>
+ <xsl:when test="name(.) = 'a'">
+ <xsl:call-template name="a_menu"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates mode="menu" select="*|text()|@*"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
</xsl:stylesheet>