Git Product home page Git Product logo

sitebricks-doc-generator's Introduction

This maven plugin auto-generates documentation for Sitebricks API services.

The plugin will scan your sources directory (by default this is src/main/java) for Sitebricks services.
A Sitebricks service is a class annotated @Service and @At (see below).
The plugin will generate the documentation in your output directory (by default this is target).
There is one documentation file created per class.

In order to use this plugin in a project, add the following to your pom:

<build>
    <plugins>
        <plugin>
            <groupId>biz.neustar.webmetrics.maven.plugins</groupId>
            <artifactId>sitebricks-doc-generator</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <id>generate-doc</id>
                    <goals>
                        <goal>generate-doc</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

The plugin's "generate-doc" goal is bound to the maven "site" phase by default.

To invoke this plugin goal on a project with the above configuration, simply invoke the following command at the root of the project directory:

mvn site

To invoke this plugin goal on a project without the above configuration, issue the following command at the root of the project directory:

mvn biz.neustar.webmetrics.maven.plugins:sitebricks-doc-generator:1.0-SNAPSHOT:generate-doc


The following class is an example of a Sitebricks service:

package sample;

import com.google.inject.name.Named;
import com.google.sitebricks.At;
import com.google.sitebricks.headless.Reply;
import com.google.sitebricks.headless.Service;
import com.google.sitebricks.http.Get;

@Service
@At("/example-service/api/1.0")
public class ExampleService {

    /**
     * Echos a message to the caller.
     * @param message the message to echo
     * @return the message
     */
    @Get
    @At("/echo/:message")
    public Reply<String> echo(@Named("message") String message){
        return Reply.with(message);
    }
}


When the sitebricks-doc-generator plugin is executed on a project that contains the above service, a file named sample.ExampleService.txt is
created with the following contents:

================================
GET /example-service/api/1.0/echo/:message

Echos a message to the caller.
URL fields:
 - message the message to echo
================================

sitebricks-doc-generator's People

Contributors

lightbody avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.