Search in sources :

Example 1 with Asciidoctor

use of org.moduliths.docs.Asciidoctor in project moduliths by moduliths.

the class Documenter method toModuleCanvas.

public String toModuleCanvas(Module module, CanvasOptions options) {
    Asciidoctor asciidoctor = Asciidoctor.withJavadocBase(modules, options.getApiBase());
    Function<List<JavaClass>, String> mapper = asciidoctor::typesToBulletPoints;
    StringBuilder builder = new StringBuilder();
    builder.append(startTable("%autowidth.stretch, cols=\"h,a\""));
    builder.append(writeTableRow("Base package", asciidoctor.toInlineCode(module.getBasePackage().getName())));
    builder.append(writeTableRow("Spring components", asciidoctor.renderSpringBeans(options, module)));
    builder.append(addTableRow(module.getAggregateRoots(), "Aggregate roots", mapper));
    builder.append(writeTableRow("Published events", asciidoctor.renderEvents(module)));
    builder.append(addTableRow(module.getEventsListenedTo(modules), "Events listened to", mapper));
    builder.append(writeTableRow("Properties", asciidoctor.renderConfigurationProperties(module, properties.getModuleProperties(module))));
    builder.append(startOrEndTable());
    return builder.toString();
}
Also used : Asciidoctor(org.moduliths.docs.Asciidoctor)

Aggregations

Asciidoctor (org.moduliths.docs.Asciidoctor)1