Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add --github-nested-index for generating docs/generators/README.md
  • Loading branch information
jimschubert committed Jan 19, 2020
commit 16a25d322f5eb81d06b53199f2a0d9ce55a0936b
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public class ListGenerators implements Runnable {
@Option(name = {"-d", "--docsite" }, description = "format for docusaurus site output", hidden = true)
private Boolean docusaurus = false;

@Option(name = {"--github-nested-index" }, description = "format for github index at docs/generators/README.md", hidden = true)
private Boolean githubNestedIndex = false;

@Option(name = {"-i", "--include" },
description = "comma-separated list of stability indexes to include (value: all,beta,stable,experimental,deprecated). Excludes deprecated by default.",
allowedValues = { "all", "beta", "stable", "experimental", "deprecated" })
Expand Down Expand Up @@ -85,7 +88,7 @@ private void appendForType(StringBuilder sb, CodegenType type, String typeName,
.collect(Collectors.toList());

if(!list.isEmpty()) {
if (docusaurus) {
if (docusaurus || githubNestedIndex) {
sb.append("## ").append(typeName).append(" generators");
} else {
sb.append(typeName).append(" generators:");
Expand All @@ -94,9 +97,10 @@ private void appendForType(StringBuilder sb, CodegenType type, String typeName,

list.forEach(generator -> {
GeneratorMetadata meta = generator.getGeneratorMetadata();
if (docusaurus) {
if (docusaurus || githubNestedIndex) {
sb.append("* ");
String id = "generators/" + generator.getName() + ".md";
String idPrefix = docusaurus ? "generators/" : "";
String id = idPrefix + generator.getName() + ".md";
sb.append("[").append(generator.getName());

if (meta != null && meta.getStability() != null && meta.getStability() != Stability.STABLE) {
Expand Down