21

The documentation created by running grails doc is not completely satisfactory in my eyes. For example, actions in controllers appear as properties in the documentation, though I would wish to have an extra section to separate actions from actual properties (Strings etc.).

Are there any tools that operate on JavaDoc-like comments and generate better output for Grails projects? It should be either Grails-aware (i.e. understands that closures in controllers are actually actions) or allow explicit tagging (e.g. a @section Actions comment makes the paragraph appear in a section called "Actions")

Erich Kitzmueller
  • 36,381
  • 5
  • 80
  • 102

3 Answers3

8

Take a look at the grails-new-doc project.

Ben Klein
  • 1,719
  • 3
  • 18
  • 41
aholub7x
  • 808
  • 12
  • 26
1

It sounds like you are running an older version of Grails.

The latest version of Grails contains many improvements in grails doc. In addition, Grails now recommends controller actions should be coded as methods rather than closures, which may address your issue.

If you are concerned about upgrading, I've been using Grails since 2008 and always upgrade when new versions come out.

It has never taken more than one day to upgrade Grails, update code to address any documented "breaking changes", run the tests, and revert if I find any issues.

Since upgrading is so easy, I always try to keep up with the latest stable release.

By the way plugins can be problematic. You should, or course, have tests for any plugins you use. In fact the better plugins already include tests, which you can run.

  • Thanks a lot. A few weeks ago, we have already upgraded to the latest version of grails, but as you can see, this question is from 2010. Anyway, I'll give the new grailsdoc a try. – Erich Kitzmueller Mar 05 '13 at 12:10
1

Check out "Grails Runtime Docs" plugin ( http://grails.org/plugin/grails-runtime-docs ). It will generate groovy documentation from runtime including the dynamic methods, adding "Dynamic Method Summary" & "Dynamic Method Detail" in the generated html docs which provide their source information. It's more Grails aware and categorizes the classes into Controllers, Commands, Domains, Services and Tag Libraries. Note: I'm a grails developer and contributed this open-source plugin to Grails myself. Hope you find it useful.

Srinath Anantha
  • 108
  • 1
  • 7
  • You should disclose that the link is to a document you created – Stephen Feb 23 '12 at 13:00
  • @Skuld : Thanks for the suggestion. I have just learned about the disclosure and edited my answer accordingly. The page is created by grails for the author on contributing a plugin. Thanks. – Srinath Anantha Feb 23 '12 at 16:27
  • No worries, just a heads up really, if you over post and don't disclose you could potentially get flagged as spam. :) – Stephen Feb 24 '12 at 08:40