You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-users@maven.apache.org by David Roussel <na...@diroussel.xsmail.com> on 2007/10/04 13:42:45 UTC

apt macro in doxia book not working

Hi,

I'm using doxia-maven-plugin 1.0-alpha-9 using APT as the input format.   I
can get it to generate latex, pdf, xdoc, rtf, xhtml.

However, if I try to use a macro as documented
(http://maven.apache.org/doxia/macros/index.html), like the example that
follows.  Then the macro is not expanded, it is just ignored.  Any ideas for
fixes?

Thanks

David

Example APT with macro....

 ------
Title
 ------
John Smith
David Jones
 ------
27 September 2007
 ------

Title

~~ Use table of contents macro

%{toc|section=2|fromDepth=0|toDepth=4}

* Introduction 

  Blah blah blah blah blah blah blah blah blah blah...

-- 
View this message in context: http://www.nabble.com/apt-macro-in-doxia-book-not-working-tf4568267.html#a13038140
Sent from the Doxia - Users mailing list archive at Nabble.com.


Re: apt macro in doxia book not working

Posted by Wendy Smoak <ws...@gmail.com>.
On 10/5/07, David Roussel <na...@diroussel.xsmail.com> wrote:

> In testing I've come up with a few rules that need to be known when using
> the Toc macro
>
>  * toDepth can't be greater than the max depth of sections (kind of annoying
> as you have to keep it in sync)
>  * each section heading must be an anchor or the PDF generation fails.  The
> APT parser doesn't error.  Not sure where the real problem is, once you know
> it it's ok.  But trying to work out why the generation is failing takes alot
> of trial and error.
>
> Should I raise bugs for those issues?

If not bugs then at least a patch or suggestion for the docs...
http://maven.apache.org/doxia/macros/index.html

Thanks!
-- 
Wendy

Re: apt macro in doxia book not working

Posted by David Roussel <na...@diroussel.xsmail.com>.
I ran the test cases you linked to, inserted some System.out etc, and found
that it was because I was putting the toc macro after my first title.  If I
moved it forward, then it all works fine.

Thanks for the hint,  test cases rock, etc.

In testing I've come up with a few rules that need to be known when using
the Toc macro

 * toDepth can't be greater than the max depth of sections (kind of annoying
as you have to keep it in sync)
 * each section heading must be an anchor or the PDF generation fails.  The
APT parser doesn't error.  Not sure where the real problem is, once you know
it it's ok.  But trying to work out why the generation is failing takes alot
of trial and error.

Should I raise bugs for those issues?

David



Vincent Siveton wrote:
> 
> Hi David,
> 
> It should work, see the test case [1].
> However, as Lukas said, open a jira ticket so we could try to
> reproduce your problem.
> 
> Cheers,
> 
> Vincent
> 
> [1]
> https://svn.apache.org/repos/asf/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
> #testTocMacro()
> 
> 2007/10/4, David Roussel <na...@diroussel.xsmail.com>:
>>
>> Hi,
>>
>> I'm using doxia-maven-plugin 1.0-alpha-9 using APT as the input format.  
>> I
>> can get it to generate latex, pdf, xdoc, rtf, xhtml.
>>
>> However, if I try to use a macro as documented
>> (http://maven.apache.org/doxia/macros/index.html), like the example that
>> follows.  Then the macro is not expanded, it is just ignored.  Any ideas
>> for
>> fixes?
>>
>> Thanks
>>
>> David
>>
>> Example APT with macro....
>>
>>  ------
>> Title
>>  ------
>> John Smith
>> David Jones
>>  ------
>> 27 September 2007
>>  ------
>>
>> Title
>>
>> ~~ Use table of contents macro
>>
>> %{toc|section=2|fromDepth=0|toDepth=4}
>>
>> * Introduction
>>
>>   Blah blah blah blah blah blah blah blah blah blah...
>>
>> --
>> View this message in context:
>> http://www.nabble.com/apt-macro-in-doxia-book-not-working-tf4568267.html#a13038140
>> Sent from the Doxia - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/apt-macro-in-doxia-book-not-working-tf4568267.html#a13061296
Sent from the Doxia - Users mailing list archive at Nabble.com.


Re: apt macro in doxia book not working

Posted by Vincent Siveton <vi...@gmail.com>.
Hi David,

It should work, see the test case [1].
However, as Lukas said, open a jira ticket so we could try to
reproduce your problem.

Cheers,

Vincent

[1] https://svn.apache.org/repos/asf/maven/doxia/doxia/trunk/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
#testTocMacro()

2007/10/4, David Roussel <na...@diroussel.xsmail.com>:
>
> Hi,
>
> I'm using doxia-maven-plugin 1.0-alpha-9 using APT as the input format.   I
> can get it to generate latex, pdf, xdoc, rtf, xhtml.
>
> However, if I try to use a macro as documented
> (http://maven.apache.org/doxia/macros/index.html), like the example that
> follows.  Then the macro is not expanded, it is just ignored.  Any ideas for
> fixes?
>
> Thanks
>
> David
>
> Example APT with macro....
>
>  ------
> Title
>  ------
> John Smith
> David Jones
>  ------
> 27 September 2007
>  ------
>
> Title
>
> ~~ Use table of contents macro
>
> %{toc|section=2|fromDepth=0|toDepth=4}
>
> * Introduction
>
>   Blah blah blah blah blah blah blah blah blah blah...
>
> --
> View this message in context: http://www.nabble.com/apt-macro-in-doxia-book-not-working-tf4568267.html#a13038140
> Sent from the Doxia - Users mailing list archive at Nabble.com.
>
>

Re: apt macro in doxia book not working

Posted by Lukas Theussl <lt...@apache.org>.
Best thing would be to open a JIRA ticket ( 
http://jira.codehaus.org/browse/DOXIA ) and attach a simple test project.

Thanks!
-Lukas


David Roussel wrote:
> Hi,
> 
> I'm using doxia-maven-plugin 1.0-alpha-9 using APT as the input format.   I
> can get it to generate latex, pdf, xdoc, rtf, xhtml.
> 
> However, if I try to use a macro as documented
> (http://maven.apache.org/doxia/macros/index.html), like the example that
> follows.  Then the macro is not expanded, it is just ignored.  Any ideas for
> fixes?
> 
> Thanks
> 
> David
> 
> Example APT with macro....
> 
>  ------
> Title
>  ------
> John Smith
> David Jones
>  ------
> 27 September 2007
>  ------
> 
> Title
> 
> ~~ Use table of contents macro
> 
> %{toc|section=2|fromDepth=0|toDepth=4}
> 
> * Introduction 
> 
>   Blah blah blah blah blah blah blah blah blah blah...
>