Skip to content

Commit e3abac2

Browse files
committed
allow defining a jooby library other than 'core'
Signed-off-by: Lewis Birks <22620804+lewisbirks@users.noreply.github.com>
1 parent da2b976 commit e3abac2

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

docs/src/main/java/io/jooby/adoc/JavadocProcessor.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public JavadocProcessor(String name) {
2222

2323
@Override
2424
public PhraseNode process(StructuralNode parent, String clazz, Map<String, Object> attributes) {
25-
StringBuilder link =
26-
new StringBuilder("https://www.javadoc.io/doc/io.jooby/jooby/latest/io.jooby/io/jooby/");
25+
StringBuilder link = generateLink(attributes);
26+
2727
StringBuilder text = new StringBuilder();
2828
String[] names = clazz.split("\\.");
2929
List<String> pkg = new ArrayList<>();
@@ -93,4 +93,18 @@ public PhraseNode process(StructuralNode parent, String clazz, Map<String, Objec
9393
options.put("target", link.toString());
9494
return createPhraseNode(parent, "anchor", text.toString(), attributes, options);
9595
}
96+
97+
private static StringBuilder generateLink(Map<String, Object> attributes) {
98+
String library = (String) attributes.get("library");
99+
StringBuilder link = new StringBuilder("https://www.javadoc.io/doc/io.jooby/jooby");
100+
if (library != null) {
101+
link.append("-").append(library);
102+
}
103+
link.append("/latest/io.jooby");
104+
if (library != null) {
105+
link.append('.').append(library);
106+
}
107+
link.append("/io/jooby/");
108+
return link;
109+
}
96110
}

0 commit comments

Comments
 (0)