in buildSrc/src/main/groovy/org/grails/plugin/PluginsPage.groovy [182:207]
static String topRatedPlugins(String siteUrl, List<Plugin> plugins) {
List<Plugin> pluginsWithStars = plugins.stream()
.filter(p -> p.githubStars != null)
.sorted(COMPARE_BY_GITHUB_STARS)
.collect(Collectors.toList())
List<Plugin> topRatedPlugins = []
for (Plugin plugin : pluginsWithStars) {
if (topRatedPlugins.stream().noneMatch(p -> p.vcsUrl == plugin.vcsUrl)) {
topRatedPlugins.add(plugin)
}
}
topRatedPlugins = topRatedPlugins.take(5)
StringWriter writer = new StringWriter()
MarkupBuilder html = new MarkupBuilder(writer)
html.div {
mkp.yieldUnescaped createHeader('Top Rated Plugins')
div {
ul {
for (Plugin plugin : topRatedPlugins) {
mkp.yieldUnescaped renderSinglePlugin(siteUrl, plugin)
}
}
}
}
writer.toString()
}