-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
358 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/test/java/com/dtsx/astra/cli/docs/MarkDownDocumentationGenerator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.dtsx.astra.cli.docs; | ||
|
||
import com.dtsx.astra.cli.AstraCli; | ||
import com.github.rvesse.airline.Cli; | ||
import com.github.rvesse.airline.help.GlobalUsageGenerator; | ||
import com.github.rvesse.airline.help.markdown.MarkdownMultiPageGlobalUsageGenerator; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
|
||
public class MarkDownDocumentationGenerator { | ||
|
||
@Test | ||
public void generateMDDocumentation() { | ||
Cli<Runnable> cli = new Cli<>(AstraCli.class); | ||
|
||
GlobalUsageGenerator<Runnable> helpGenerator = new MarkdownMultiPageGlobalUsageGenerator<>(); | ||
try { | ||
//helpGenerator.usage(cli.getMetadata(), System.out); | ||
|
||
FileOutputStream out = new FileOutputStream("cli.md"); | ||
helpGenerator.usage(cli.getMetadata(), out); | ||
|
||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.