Skip to content

Commit

Permalink
Fix to correctly create references for config documentation provider …
Browse files Browse the repository at this point in the history
…implementations.
  • Loading branch information
tomas-langer committed Nov 21, 2024
1 parent c087857 commit 35f0742
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,9 @@ public List<CmType> getTypes() {
public void setTypes(List<CmType> types) {
this.types = types;
}

@Override
public String toString() {
return module;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
import java.util.Comparator;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -205,10 +207,13 @@ public void process() {

// map of annotated types to documentation
Map<String, CmType> configuredTypes = new HashMap<>();
Set<String> allTypes = new HashSet<>();

for (CmModule module : allModules) {
for (CmType type : module.getTypes()) {
configuredTypes.put(type.getAnnotatedType(), type);
allTypes.add(type.getAnnotatedType());
allTypes.add(type.getType());
}
}

Expand All @@ -225,7 +230,7 @@ public void process() {

List<String> generatedFiles = new LinkedList<>();
for (CmModule module : allModules) {
moduleDocs(configuredTypes, typeTemplate, path, module, generatedFiles);
moduleDocs(allTypes, configuredTypes, typeTemplate, path, module, generatedFiles);
}

// sort alphabetically by page title
Expand Down Expand Up @@ -320,14 +325,15 @@ private static String title(String typeName) {
return title;
}

private static void moduleDocs(Map<String, CmType> configuredTypes,
private static void moduleDocs(Set<String> allTypes,
Map<String, CmType> configuredTypes,
Template template,
Path modulePath,
CmModule module,
List<String> generatedFiles) {
Function<String, Boolean> exists = type -> {
// 1: check if part of this processing
if (configuredTypes.containsKey(type)) {
if (allTypes.contains(type)) {
return true;
}
// 2: check if exists in target directory
Expand Down

0 comments on commit 35f0742

Please sign in to comment.