Presenter
Generates markdown documentation for commands.
Example:
Presenter.generateFor({
command: 'release',
description: 'Bundles source files for release.',
options: [{ flag: '-f, --force', description: "Overwrite target file" }],
examples: [{ command: '-o path/to/target', description: "Changes output directory" }]
});
// => ## release
// Bundles source files for release.
//
// ### Options
// **-f, --force**: Overwrite target file
//
// ### Examples
// $ shinka release -o path/to/target # Changes output directory
Test:
Static Member Summary
Static Public Members | ||
public static |
generateFor(cmd: Command): string: * Generates documentation for given command. |
Static Method Summary
Static Public Methods | ||
public static |
buildExamples(cmd: Command): string[] Transforms examples to list of strings. |
|
public static |
buildOptions(cmd: Command): string[] Transforms options to list of strings. |
Static Public Members
Static Public Methods
public static buildExamples(cmd: Command): string[] source
Transforms examples to list of strings.
Example:
Presenter.buildExamples({
command: "release",
examples: [{ command: '-o path/to/target', description: "Changes output directory" }]
});
// => ['### Examples',
// '```shell',
// '$ release -o path/to/target # Changes output directory',
// '```']