Question

Is it possible to run Marginalia on a Java (multi-module) project which uses Maven?

Or is there any other alternative that's similar to Marginalia or Docco that can do this?

What's important to me is to be able to add it as a dependency from some public Maven repository and to use it straight away, without installing any additional stuff like Node.js for Docco for example - which is reasonable since it's a Java project.

Was it helpful?

Solution

I've tried several options:

  • Marginalia with the Zi plugin;
  • Jocco (though it is not published on any Maven repo);
  • and then, I found atlasssian-docco!

I'll have to revise my comments formatting to fit the guide, but I think this Maven plugin will do the job. Any thoughts?

OTHER TIPS

If people are still searching for an alternative programming Documentation Generator to javadoc. I have tried Atlassian Docco, but the generated doc is not so appealing and readable. Then found out Groc. As of now far better than former. Groc aims to support Literate Programming. Give it a try. Seems like Groc does not contain Maven dependency

docufier is a tool that turns classes with doc comments (e.g. unit tests) into markdown. There is also a maven plugin.

An example would be the following test case:

/**
 *
 * Output and Input
 * ----------------
 *
 * For more control over the execution we'll use a `ProcBuilder` instance to configure
 * the process.
 *
 * The run method builds and spawns the actual process and blocks until the process exits.
 * The process takes care of writing the output to a stream, as opposed to the standard
 * facilities in the JDK that expect the client to actively consume the
 * output from an input stream:
 */
@Test
public void testOutputToStream() {
    ByteArrayOutputStream output = new ByteArrayOutputStream();

    new ProcBuilder("echo")
        .withArg("Hello World!")
        .withOutputStream(output)
        .run();

    assertEquals("Hello World!\n", output.toString());
}

Which will be rendered to the following markdown:

Output and Input
----------------

For more control over the execution we'll use a `ProcBuilder` instance to configure
the process.

The run method builds and spawns the actual process and blocks until the process exits.
The process takes care of writing the output to a stream, as opposed to the standard
facilities in the JDK that expect the client to actively consume the
output from an input stream:

~~~ .java
ByteArrayOutputStream output = new ByteArrayOutputStream();

new ProcBuilder("echo")
    .withArg("Hello World!")
    .withOutputStream(output)
    .run();

assertEquals("Hello World!\n", output.toString());
~~~

For a full example refer to the README.md of the jproc project, which has been generated from the acceptance test suite.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top