Author: wsmoak
Date: Sat Mar 10 11:34:13 2007
New Revision: 516772
URL: http://svn.apache.org/viewvc?view=rev&rev=516772
Log:
Add a page on Doxia macros.
Added:
maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt (with
props)
Modified:
maven/doxia/trunk/doxia-site/src/site/site.xml
Added: maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt?view=auto&rev=516772
==============================================================================
--- maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt (added)
+++ maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt Sat Mar 10
11:34:13 2007
@@ -0,0 +1,89 @@
+ ------
+ Guide to Doxia Macros
+ ------
+ The Maven Team
+ ------
+ 25 November 2006
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+Guide to Doxia Macros
+
+ The Doxia Core module includes the Echo and Snippet macros, and you can create
+ your own.
+
+ Macros are Plexus components with a role of
org.apache.macro.doxia.macro.Macro.
+ The role-hint is the macro name.
+
+ For example:
+
+-----
+/**
+ * @plexus.component role="org.apache.maven.doxia.macro.Macro"
+ * role-hint="echo"
+ */
+public class EchoMacro extends AbstractMacro
+{
+ public void execute( Sink sink, MacroRequest request ) { ... }
+}
+-----
+
+ is called with
+
+-----
+%{echo|param=value|param2=value2}
+-----
+
+ and will output
+
+-----
+ param ---> value
+ param2 ---> value2
+-----
+
+ (The echo macro simply prints out the key and value of any parameters that
you
+ supply.)
+
+ Note that macros <<must not>> be indented in your apt source document.
+
+~~ In the execute method, [TODO]
+
+ The following plugin config can be used to generate the Plexus component.xml
+ file for the module containing your macro:
+
+-----
+ <build>
+ ...
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ ...
+ </plugins>
+ ...
+ </build>
+-----
Propchange: maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/doxia/trunk/doxia-site/src/site/apt/guide-doxia-macros.apt
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: maven/doxia/trunk/doxia-site/src/site/site.xml
URL:
http://svn.apache.org/viewvc/maven/doxia/trunk/doxia-site/src/site/site.xml?view=diff&rev=516772&r1=516771&r2=516772
==============================================================================
--- maven/doxia/trunk/doxia-site/src/site/site.xml (original)
+++ maven/doxia/trunk/doxia-site/src/site/site.xml Sat Mar 10 11:34:13 2007
@@ -59,6 +59,7 @@
<menu name="Doxia">
<item name="Overview" href="index.html"/>
<item name="APT Format" href="format.html"/>
+ <item name="Macros" href="guide-doxia-macros.html"/>
<item name="Writing Books" href="book/index.html"/>
</menu>