diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt index b0a0e5f64b..7765246475 100644 --- a/Documentation/dev-plugins.txt +++ b/Documentation/dev-plugins.txt @@ -533,6 +533,12 @@ exist, only the first discovered file will be used. If a discovered file name beings with `cmd-` it will be clustered into a 'Commands' section of the generated index page. +If a discovered file name beings with `servlet-` it will be clustered +into a 'Servlets' section of the generated index page. + +If a discovered file name beings with `rest-api-` it will be clustered +into a 'REST APIs' section of the generated index page. + All other files are clustered under a 'Documentation' section. Some optional information from the manifest is extracted and diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java index 4b3084ac3b..53abc4c2c5 100644 --- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java +++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/plugins/HttpPluginServlet.java @@ -331,6 +331,8 @@ class HttpPluginServlet extends HttpServlet String prefix, String pluginName, ResourceKey cacheKey, HttpServletResponse res) throws IOException { List cmds = Lists.newArrayList(); + List servlets = Lists.newArrayList(); + List restApis = Lists.newArrayList(); List docs = Lists.newArrayList(); JarEntry about = null; Enumeration entries = jar.entries(); @@ -345,6 +347,10 @@ class HttpPluginServlet extends HttpServlet name = name.substring(prefix.length()); if (name.startsWith("cmd-")) { cmds.add(entry); + } else if (name.startsWith("servlet-")) { + servlets.add(entry); + } else if (name.startsWith("rest-api-")) { + restApis.add(entry); } else if (name.startsWith("about.")) { if (about == null) { about = entry; @@ -395,6 +401,8 @@ class HttpPluginServlet extends HttpServlet } appendEntriesSection(jar, docs, "Documentation", md, prefix, 0); + appendEntriesSection(jar, servlets, "Servlets", md, prefix, "servlet-".length()); + appendEntriesSection(jar, restApis, "REST APIs", md, prefix, "rest-api-".length()); appendEntriesSection(jar, cmds, "Commands", md, prefix, "cmd-".length()); sendMarkdownAsHtml(md.toString(), pluginName, cacheKey, res);