Browse Source

move ant-site proposal(s)

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@896784 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
907e2ddcea
4 changed files with 0 additions and 243 deletions
  1. +0
    -55
      proposal/ant-site/anakia/build.xml
  2. +0
    -134
      proposal/ant-site/forrest/anakia2forrest.xsl
  3. +0
    -18
      proposal/ant-site/forrest/build.xml
  4. +0
    -36
      proposal/ant-site/forrest/project2book.xsl

+ 0
- 55
proposal/ant-site/anakia/build.xml View File

@@ -1,55 +0,0 @@
<project name="build-site" default="docs" basedir=".">

<!-- Initialization properties -->
<property name="project.name" value="ant"/>
<property name="docs.src" location="xdocs"/>
<property name="docs.dest" location="docs"/>
<property name="project.file" value="stylesheets/project.xml" />
<property name="site.dir" location="../../../../jakarta-site2" />
<property name="templ.path" location="xdocs/stylesheets" />
<property name="velocity.props" location="${docs.src}/velocity.properties" />

<path id="anakia.classpath">
<fileset dir="${site.dir}/lib">
<include name="*.jar"/>
</fileset>
</path>

<target name="prepare">
<available classname="org.apache.velocity.anakia.AnakiaTask"
property="AnakiaTask.present">
<classpath refid="anakia.classpath"/>
</available>
</target>

<target depends="prepare" name="prepare-error" unless="AnakiaTask.present">
<echo>
AnakiaTask is not present! Please check to make sure that
velocity.jar is in your classpath.
</echo>
</target>

<target name="docs" depends="prepare-error" if="AnakiaTask.present">
<taskdef name="anakia" classname="org.apache.velocity.anakia.AnakiaTask">
<classpath refid="anakia.classpath"/>
</taskdef>
<anakia basedir="${docs.src}" destdir="${docs.dest}/"
extension=".html" style="./site.vsl"
projectFile="${project.file}"
excludes="**/stylesheets/**"
includes="**/*.xml"
lastModifiedCheck="true"
templatePath="${templ.path}"
velocityPropertiesFile="${velocity.props}">
</anakia>
</target>
<target name="javadocs">
<ant antfile="build.xml" target="dist_javadocs">
<property name="dist.javadocs" value="${docs.dest}/manual/api" />
</ant>
</target>
<target name="all" depends="docs, javadocs"/>
</project>

+ 0
- 134
proposal/ant-site/forrest/anakia2forrest.xsl View File

@@ -1,134 +0,0 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--

A little bit of automated transformation to help conversion
from Anakia to Forrest/Cocoon docs.
This is purely experimental, it hem...should work, well mostly
but it should manage to break a couple of things so you will
need a manual pass to fix things after that.
Stephane Bailliez, sbailliez@apache.org
-->
<xsl:output method="xml" indent="yes" doctype-system="document-v11.dtd"
doctype-public="-//APACHE//DTD Documentation V1.1//EN" encoding="ISO-8859-1"/>

<!-- properties = header in Forrest language -->
<xsl:template match="properties">
<header>
<xsl:apply-templates select="*[ local-name() != 'author']"/>
<author>
<xsl:apply-templates select="author"/>
</author>
</header>
</xsl:template>

<xsl:template match="author">
<person id="{text()}">
<!--
not everyone gives his mail in order not to receive too much spam... or be
assimilated as 24/24 7/7 support
-->
<xsl:if test="@email"><xsl:attribute name="email"><xsl:value-of select="@email"/></xsl:attribute></xsl:if>
</person>
</xsl:template>

<!-- section = subsection with forrest and the title is an element -->
<xsl:template match="section|subsection">
<section>
<title><xsl:value-of select="@name"/></title>
<xsl:apply-templates/>
</section>
</xsl:template>

<!-- Ignore those tags they should not be here, this will clean up
some but will break others, anyways. br is evil :) -->
<xsl:template match="br|nobr">
<xsl:apply-templates/>
</xsl:template>

<!-- font should not be there, it was used to do a source (or code ?)-->
<xsl:template match="font">
<source>
<xsl:apply-templates/>
</source>
</xsl:template>

<!-- assumes img = icon rather than figure -->
<xsl:template match="img">
<icon>
<xsl:apply-templates select="@alt|@src|@width|@height"/>
</icon>
</xsl:template>
<!-- assume every anchor with a name is an anchor -->
<xsl:template match="a[@name]">
<anchor>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</anchor>
</xsl:template>
<!-- try to be super smart to detect link/anchor/jump -->
<xsl:template match="a[@href]">
<xsl:choose>
<!-- something with a hashmark is a jump -->
<xsl:when test="starts-with(@href, '#')">
<jump>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</jump>
</xsl:when>
<!--
assume everything out of apache domain would be better with a fork
This is really a life style, I hate windows forking all over my
desktop but it's quite convenient sometimes when too lazy to shift.
One super thing would be to do like Microsoft.com and put an
extra icon via forrest after the link when it send outside
the apache site.
-->
<xsl:when test="starts-with(@href, 'http://') and not(contains(@href, 'apache.org'))">
<fork>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</fork>
</xsl:when>
<!-- fallback to a basic link -->
<xsl:otherwise>
<link>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</link>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<!---
Ugly hack to define an axial table
The css could be defined as text-align:right !important;
-->
<xsl:template match="table">
<table>
<!--
(tr[1]/th and tr[1]/td) would give the same result
but I'm using following-sibbling to sound super smart
and obfuscate my code. It hard to write, so it should
be hard to understand ;-)
-->
<xsl:if test="tr[1]/th[following-sibling::td]">
<xsl:attribute name="class">axial</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</table>
</xsl:template>

<!-- wide rule, copy all nodes and attributes -->
<xsl:template match="node()|@*" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

+ 0
- 18
proposal/ant-site/forrest/build.xml View File

@@ -1,18 +0,0 @@
<project name="anakia2forrest" default="run" basedir=".">

<!-- Initialization properties -->
<property name="anakia.xdocs.src" location="../anakia/xdocs"/>
<property name="docs.dest" location="docs"/>

<!-- run forrest, run ! -->
<target name="run">
<xslt force="true" basedir="${anakia.xdocs.src}" destdir="${docs.dest}"
includes="**/*.xml"
extension=".xml"
style="${basedir}/anakia2forrest.xsl"/>
<xslt force="true" in="${anakia.xdocs.src}/stylesheets/project.xml" out="${docs.dest}/book.xml"
style="${basedir}/project2book.xsl"/>
</target>

</project>

+ 0
- 36
proposal/ant-site/forrest/project2book.xsl View File

@@ -1,36 +0,0 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--

A little bit of automated transformation to help conversion
from Anakia to Forrest/Cocoon docs.
This is purely experimental, it hem...should work, well mostly
but it should manage to break a couple of things so you will
need a manual pass to fix things after that.
Stephane Bailliez, sbailliez@apache.org
-->
<xsl:output method="xml" indent="yes" doctype-system="book-cocoon-v10.dtd"
doctype-public="-//APACHE//DTD Cocoon Documentation Book V1.0//EN" encoding="ISO-8859-1"/>

<xsl:template match="project">
<book copyright="2002 The Apache Software Foundation"
xmlns:xlink="http://www.w3.org/1999/xlink"
software="{@name}"
title="{title/text()}">
<xsl:apply-templates select="body/menu"/>
</book>
</xsl:template>

<xsl:template match="menu">
<menu label="{@name}">
<xsl:apply-templates select="item"/>
</menu>
</xsl:template>

<xsl:template match="item">
<menu-item label="{@name}" href="{@href}"/>
</xsl:template>

</xsl:stylesheet>

Loading…
Cancel
Save