Alot of documentation that ships with Java projects is based on fairly
simple markup using the most basic parts of HTML: Headings, bold, italic,
bullets, the odd table, images and links.

I find editing 'xdoc' format XML files quite painful for anything other than
fairly basic documentation. I far prefer to just edit some simple HTML
document in some WYSIWYG editing tool like Mozilla or MS FrontPage - its
just so much easier to do and less risky that a typo will break the build
etc.

So for WYSIWYG fans like me, there's a new little plugin called html2xdoc.
Basically this takes normal HTML and turns it into the xdoc format that the
xdoc plugin uses to generate the website. This means that you can now mix
and match normal HTML and XML xdoc format files together to generate the
website - users can't really tell them apart.

By default the goal 'html2xdoc' will take all HTMl documents in the xdocs
directory and turn them into xdoc files in the target/generated-xdocs
directory. A nice thing about this is that the HTML documents can link to
relative images in the xdocs/images directory while editing & when the build
is done. Also all the HTML and XML documentation is in the same directory.

To allow HTML to be turned into xdoc format add the following to your
maven.xml

  <preGoal name="xdoc:jelly-transform">
    <attainGoal name="html2xdoc"/>
  </preGoal>


A quick note about the implementation. The HTML is parsed via the Jelly HTML
parsing library (and NekoHTML that does the hard work). I did try implement
this plugin via JSL or XSLT but the logic seemed way to complex to get right
so I just used good old Java to implement the complex processing.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to