Quantcast

xdoc snippet macro

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

xdoc snippet macro

Matthew Pocock
Hi,

I've got some documentation in the xdoc format. I have had the apt version of
the snippet macro working fine. However, I can't make it work from in xdoc. I
get the same error each time, regardless of how I format the macro tag.

Here are some example tags I've tried:

<macro name="snippet" id="client-code"
file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>

<macro name="snippet" snippetId="client-code"
file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>

<macro name="snippet" macroId="client-code"
file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>

All three of these give the identical error when running site:site in maven.
Any ideas?

Matthew

[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] id is a required parameter
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalArgumentException: id is a required parameter
        at
org.apache.maven.doxia.macro.snippet.SnippetMacro.required(SnippetMacro.java:256)
        at
org.apache.maven.doxia.macro.snippet.SnippetMacro.execute(SnippetMacro.java:64)
        at
org.apache.maven.doxia.parser.AbstractParser.executeMacro(AbstractParser.java:71)
        at
org.apache.maven.doxia.module.xdoc.XdocParser.handleEndTag(XdocParser.java:477)
        at
org.apache.maven.doxia.parser.AbstractXmlParser.parseXml(AbstractXmlParser.java:92)
        at
org.apache.maven.doxia.parser.AbstractXmlParser.parse(AbstractXmlParser.java:53)
        at
org.apache.maven.doxia.module.xdoc.XdocParser.parse(XdocParser.java:99)
        at org.apache.maven.doxia.DefaultDoxia.parse(DefaultDoxia.java:59)
        at
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:342)
        at
org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:46)
        at
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
        at
org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
        at
org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:129)
        at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: xdoc snippet macro

Vincent Siveton-2
Hi,

Try  the following according [1]

<macro name="snippet">
  <param name="id" value="myid"/>
  <param name="url" value="http://myserver/path/to/file.txt"/>
</macro>

Cheers,

Vincent

[1] http://maven.apache.org/doxia/macros/index.html

2008/5/12, Matthew Pocock <[hidden email]>:

> Hi,
>
>  I've got some documentation in the xdoc format. I have had the apt version of
>  the snippet macro working fine. However, I can't make it work from in xdoc. I
>  get the same error each time, regardless of how I format the macro tag.
>
>  Here are some example tags I've tried:
>
>  <macro name="snippet" id="client-code"
>  file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>
>
>  <macro name="snippet" snippetId="client-code"
>  file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>
>
>  <macro name="snippet" macroId="client-code"
>  file="src/site/resources/gettingStartedCommandLineClient/src/main/java/Client.java"/>
>
>  All three of these give the identical error when running site:site in maven.
>  Any ideas?
>
>  Matthew
>
>  [ERROR] FATAL ERROR
>  [INFO] ------------------------------------------------------------------------
>  [INFO] id is a required parameter
>  [INFO] ------------------------------------------------------------------------
>  [INFO] Trace
>  java.lang.IllegalArgumentException: id is a required parameter
>         at
>  org.apache.maven.doxia.macro.snippet.SnippetMacro.required(SnippetMacro.java:256)
>         at
>  org.apache.maven.doxia.macro.snippet.SnippetMacro.execute(SnippetMacro.java:64)
>         at
>  org.apache.maven.doxia.parser.AbstractParser.executeMacro(AbstractParser.java:71)
>         at
>  org.apache.maven.doxia.module.xdoc.XdocParser.handleEndTag(XdocParser.java:477)
>         at
>  org.apache.maven.doxia.parser.AbstractXmlParser.parseXml(AbstractXmlParser.java:92)
>         at
>  org.apache.maven.doxia.parser.AbstractXmlParser.parse(AbstractXmlParser.java:53)
>         at
>  org.apache.maven.doxia.module.xdoc.XdocParser.parse(XdocParser.java:99)
>         at org.apache.maven.doxia.DefaultDoxia.parse(DefaultDoxia.java:59)
>         at
>  org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:342)
>         at
>  org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:46)
>         at
>  org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:269)
>         at
>  org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:101)
>         at
>  org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:129)
>         at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:96)
>         at
>  org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:512)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>         at
>  org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
>  org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: xdoc snippet macro

Matthew Pocock
In reply to this post by Matthew Pocock
Ah, thanks - this works well.

Is there a short-hand for including an entire file? I seem to need to supply
the id regardless.

Is there a macro that lets me dump the output of running a program into the
docs? E.g. if the docs describe building a java command-line app, it would be
nice to run it during the site build and capture the output into the docs
directly.

Matthew

On Monday 12 May 2008, Vincent Siveton wrote:

> Hi,
>
> Try  the following according [1]
>
> <macro name="snippet">
>   <param name="id" value="myid"/>
>   <param name="url" value="http://myserver/path/to/file.txt"/>
> </macro>
>
> Cheers,
>
> Vincent
>
> [1] http://maven.apache.org/doxia/macros/index.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: xdoc snippet macro

Lukas Theussl-4


Matthew Pocock wrote:
> Ah, thanks - this works well.
>
> Is there a short-hand for including an entire file? I seem to need to supply
> the id regardless.

This is possible in beta-1 only (not yet released):
http://jira.codehaus.org/browse/DOXIA-210

>
> Is there a macro that lets me dump the output of running a program into the
> docs? E.g. if the docs describe building a java command-line app, it would be
> nice to run it during the site build and capture the output into the docs
> directly.

The only macros currently available are the ones listed in the Macros
Guide. Contributions welcome... :)

HTH,
-Lukas

>
> Matthew
>
> On Monday 12 May 2008, Vincent Siveton wrote:
>
>>Hi,
>>
>>Try  the following according [1]
>>
>><macro name="snippet">
>>  <param name="id" value="myid"/>
>>  <param name="url" value="http://myserver/path/to/file.txt"/>
>></macro>
>>
>>Cheers,
>>
>>Vincent
>>
>>[1] http://maven.apache.org/doxia/macros/index.html
>
>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: xdoc snippet macro

Matthew Pocock
On Tuesday 13 May 2008, Lukas Theussl wrote:
> Matthew Pocock wrote:
> > Ah, thanks - this works well.
> >
> > Is there a short-hand for including an entire file? I seem to need to
> > supply the id regardless.
>
> This is possible in beta-1 only (not yet released):
> http://jira.codehaus.org/browse/DOXIA-210

OK, cool.

One more thing - I have a single java source file with multiple, overlapping
snippets. When a snipped it imported that contains snippet comments within
it, these comments are imported as well. Would it be possible to strip out
snippet comments?

> > Is there a macro that lets me dump the output of running a program into
> > the docs? E.g. if the docs describe building a java command-line app, it
> > would be nice to run it during the site build and capture the output into
> > the docs directly.
>
> The only macros currently available are the ones listed in the Macros
> Guide. Contributions welcome... :)

Ah, OK. Thanks.

Matthew


>
> HTH,
> -Lukas
>
> > Matthew
Loading...