8

In Python, when commenting a function, you can do it in a way that makes it easier for documentation to be automatically generated. They refer to it as a docstring.

Now that I've made an abstract class in Groovy that I'd like to pass around, is there a standard way I should comment it as well? Are there any Groovy tools to generate basic documentation from code comments?

techHenson
  • 93
  • 1
  • 5
  • 1
    You mean like Groovydoc http://www.javaworld.com/article/2074120/core-java/documenting-groovy-with-groovydoc.html ? – tim_yates Oct 03 '14 at 15:43
  • 1
    More docs: http://docs.groovy-lang.org/docs/next/html/documentation/#_groovydoc_the_groovy_java_documentation_generator – tim_yates Oct 03 '14 at 15:48
  • Thanks @tim_yates! Groovydoc is exactly what I'm looking for. Another answer I found (for those who don't like embedding HTML) is [asciidoclet](https://github.com/asciidoctor/asciidoclet), which I thought I'd mention. – techHenson Oct 05 '14 at 17:44

1 Answers1

2

Documenting Groovy with Groovydoc is a nice starting point:

"Groovydoc was introduced in 2007 to provide for Groovy what Javadoc provides for Java. Groovydoc is used to generate the API documentation for the Groovy and Java classes that compose the Groovy language."