diff --git a/cli/src/test/java/io/kestra/cli/commands/plugins/PluginDocCommandTest.java b/cli/src/test/java/io/kestra/cli/commands/plugins/PluginDocCommandTest.java index cf6475759b5..f487b53ea87 100644 --- a/cli/src/test/java/io/kestra/cli/commands/plugins/PluginDocCommandTest.java +++ b/cli/src/test/java/io/kestra/cli/commands/plugins/PluginDocCommandTest.java @@ -63,6 +63,10 @@ void run() throws IOException, URISyntaxException { "# Plugin template test\n" + "\n" + "Plugin template for Kestra\n" + + "\n" + + "This is a more complex description of the plugin.\n" + + "\n" + + "This is in markdown and will be inline inside the plugin page.\n" + "## Subgroup title\n" + " \n" + "Subgroup description\n" + diff --git a/cli/src/test/resources/plugins/plugin-template-test-0.6.0-SNAPSHOT.jar b/cli/src/test/resources/plugins/plugin-template-test-0.6.0-SNAPSHOT.jar index 50de540d09b..47041dde074 100644 Binary files a/cli/src/test/resources/plugins/plugin-template-test-0.6.0-SNAPSHOT.jar and b/cli/src/test/resources/plugins/plugin-template-test-0.6.0-SNAPSHOT.jar differ diff --git a/core/src/main/java/io/kestra/core/docs/DocumentationGenerator.java b/core/src/main/java/io/kestra/core/docs/DocumentationGenerator.java index 80ad12037cd..96dd8e6bbf1 100644 --- a/core/src/main/java/io/kestra/core/docs/DocumentationGenerator.java +++ b/core/src/main/java/io/kestra/core/docs/DocumentationGenerator.java @@ -85,7 +85,9 @@ private static List index(RegisteredPlugin plugin) throws IOException if (plugin.getManifest() != null) { builder.put("title", plugin.getManifest().getMainAttributes().getValue("X-Kestra-Title")); builder.put("description", plugin.getManifest().getMainAttributes().getValue("X-Kestra-Description")); - builder.put("group", plugin.getManifest().getMainAttributes().getValue("X-Kestra-Group")); + var group = plugin.getManifest().getMainAttributes().getValue("X-Kestra-Group"); + builder.put("group", group); + longDescription(plugin, builder, group); builder.put("classPlugins", pluginDocumentation.getClassPlugins()); } @@ -96,6 +98,17 @@ private static List index(RegisteredPlugin plugin) throws IOException )); } + private static void longDescription(RegisteredPlugin plugin, ImmutableMap.Builder builder, String group) { + try (var is = plugin.getClassLoader().getResourceAsStream("doc/" + group + ".md")) { + if(is != null) { + builder.put("longDescription", IOUtils.toString(is, Charsets.UTF_8)); + } + } + catch (Exception e) { + // silently fail + } + } + private List generate(RegisteredPlugin registeredPlugin, List> cls, Class baseCls, String type) { return cls .stream() diff --git a/core/src/main/resources/docs/index.hbs b/core/src/main/resources/docs/index.hbs index 250e7e9440e..02d88fce1db 100644 --- a/core/src/main/resources/docs/index.hbs +++ b/core/src/main/resources/docs/index.hbs @@ -6,6 +6,8 @@ editLink: false {{ description }} +{{ longDescription }} + {{~#each classPlugins }} {{~#if @key.title}} ## {{ @key.title }}