or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

doc-generation.mddoc-model.mdindex.mdoutput-management.mdtemplate-engine.md
tile.json

tessl/maven-org-apache-groovy--groovy-groovydoc

A documentation generation tool for Groovy code, part of the Apache Groovy programming language suite

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/org.apache.groovy/groovy-groovydoc@5.0.x

To install, run

npx @tessl/cli install tessl/maven-org-apache-groovy--groovy-groovydoc@5.0.0

index.mddocs/

Groovy-GroovyDoc

Groovy-GroovyDoc is a comprehensive documentation generation tool specifically designed for Groovy code, part of the Apache Groovy programming language suite. Similar to JavaDoc but tailored for Groovy's dynamic language features, it parses Groovy source files, extracts documentation comments and code structure, and generates HTML documentation with support for both Java and Groovy syntax.

Package Information

  • Package Name: groovy-groovydoc
  • Package Type: maven
  • Group ID: org.apache.groovy
  • Language: Java
  • Installation: Add dependency to build.gradle:
dependencies {
    implementation 'org.apache.groovy:groovy-groovydoc:5.0.0'
}

Or Maven:

<dependency>
    <groupId>org.apache.groovy</groupId>
    <artifactId>groovy-groovydoc</artifactId>
    <version>5.0.0</version>
</dependency>

Core Imports

import org.codehaus.groovy.tools.groovydoc.GroovyDocTool;
import org.codehaus.groovy.groovydoc.GroovyRootDoc;
import org.codehaus.groovy.tools.groovydoc.FileOutputTool;
import org.codehaus.groovy.tools.groovydoc.FileSystemResourceManager;

Basic Usage

import org.codehaus.groovy.tools.groovydoc.GroovyDocTool;
import org.codehaus.groovy.groovydoc.GroovyRootDoc;
import org.codehaus.groovy.tools.groovydoc.FileOutputTool;

// Basic documentation generation
String[] sourcePaths = {"/path/to/groovy/source"};
GroovyDocTool tool = new GroovyDocTool(sourcePaths);

// Add source files to process
List<String> sourceFiles = Arrays.asList(
    "com/example/MyClass.groovy",
    "com/example/MyInterface.groovy"
);
tool.add(sourceFiles);

// Generate documentation to output directory
FileOutputTool output = new FileOutputTool();
tool.renderToOutput(output, "/path/to/output/docs");

Architecture

The Groovy-GroovyDoc system is built around several key components:

  • Documentation Tool - The main API for generating documentation from source code
  • Documentation Model - A hierarchical object model representing the parsed documentation structure
  • Output Management - Flexible system for writing generated documentation to various targets
  • Template Engine - Groovy-based template processing for customizable documentation output
  • Resource Management - System for loading templates and resources from filesystem or classpath

Capabilities

Documentation Generation

The core functionality for generating documentation from Groovy source code, including parsing source files, extracting comments, and creating the documentation model.

// Basic tool creation and usage
GroovyDocTool tool = new GroovyDocTool(sourcePaths);
tool.add(sourceFiles);
GroovyRootDoc rootDoc = tool.getRootDoc();

Key API components:

  • GroovyDocTool - Main entry point for documentation generation
  • GroovyRootDoc getRootDoc() - Access to the complete documentation model

Documentation Generation

Documentation Model

A comprehensive object model that represents the structure of documented code, including packages, classes, methods, fields, and their relationships.

// Access documentation model
GroovyRootDoc rootDoc = tool.getRootDoc();
GroovyClassDoc[] classes = rootDoc.classes();
GroovyPackageDoc[] packages = rootDoc.specifiedPackages();

Key API components:

  • GroovyRootDoc - Root of the documentation tree
  • GroovyClassDoc - Class and interface documentation
  • GroovyMethodDoc, GroovyFieldDoc - Member documentation
  • GroovyPackageDoc - Package-level documentation

Documentation Model

Output Management

Flexible system for writing generated documentation to various output targets, including file system, in-memory storage, and custom implementations.

// File system output
FileOutputTool fileOutput = new FileOutputTool();
tool.renderToOutput(fileOutput, "/output/directory");

// In-memory output for testing
MockOutputTool mockOutput = new MockOutputTool();
tool.renderToOutput(mockOutput, "test-docs");

Key API components:

  • OutputTool - Abstract interface for output targets
  • FileOutputTool - File system output implementation
  • MockOutputTool - In-memory output for testing

Output Management

Template Engine

Groovy-based template processing system that allows customization of generated documentation appearance and structure.

// Template engine with custom templates
String[] classTemplates = {"custom-class-template.html"};
ResourceManager resourceManager = new FileSystemResourceManager("/templates");
GroovyDocTemplateEngine engine = new GroovyDocTemplateEngine(
    tool, resourceManager, classTemplates
);

Key API components:

  • GroovyDocTemplateEngine - Template processing engine
  • ResourceManager - Template and resource loading
  • GroovyDocTemplateInfo - Default template configurations

Template Engine