diff --git a/ansi-escape/README.md b/ansi-escape/README.md index 9128916e..399f5fb9 100644 --- a/ansi-escape/README.md +++ b/ansi-escape/README.md @@ -26,7 +26,35 @@ >_ Used by cliffy's prompt module

-## Usage +## ❯ Content + +- [Install](#-install) +- [Usage](#-usage) +- [License](#-license) + +## ❯ Install + +This module can be imported directly from the repo and from following registries. + +Deno Registry + +```typescript +import { AnsiEscape } from 'https://deno.land/x/cliffy@/ansi-escape/mod.ts'; +``` + +Nest Registry + +```typescript +import { AnsiEscape } from 'https://x.nest.land/cliffy@/ansi-escape/mod.ts'; +``` + +Github + +```typescript +import { AnsiEscape } from 'https://raw.githubusercontent.com/c4spar/deno-cliffy//ansi-escape/mod.ts'; +``` + +## ❯ Usage ```typescript #!/usr/bin/env -S deno run @@ -49,6 +77,6 @@ AnsiEscape.from( Deno.stdout ) // ... ``` -## License +## ❯ License [MIT](../LICENSE) diff --git a/command/README.md b/command/README.md index 2839bec0..8c2fd17c 100644 --- a/command/README.md +++ b/command/README.md @@ -26,8 +26,11 @@ >_ Create flexible command line interfaces with type checking, auto generated help and out of the box support for shell completions

-- [Usage](#usage) -- [Options](#options) +## ❯ Content + +- [Install](#-install) +- [Usage](#-usage) +- [Options](#-options) - [Common option types: string, number and boolean](#common-option-types-string-number-and-boolean) - [List option types](#list-option-types) - [Variadic options](#variadic-options) @@ -42,7 +45,7 @@ - [Collect options](#collect-options) - [Custom option processing](#custom-option-processing) - [Option action handler](#option-action-handler) -- [Commands](#commands) +- [Commands](#-commands) - [Argument syntax](#argument-syntax) - [Action handler](#action-handler) - [Executable sub-commands](#executable-sub-commands) @@ -50,23 +53,45 @@ - [Hidden commands](#hidden-commands) - [Stop early](#stop-early) - [Override exit handling](#override-exit-handling) -- [Custom types](#custom-types) +- [Custom types](#-custom-types) - [Function types](#function-types) - [Class types](#class-types) - [Global types](#global-types) -- [Environment variables](#environment-variables) -- [Add examples](#add-examples) -- [Auto generated help](#auto-generated-help) +- [Environment variables](#-environment-variables) +- [Add examples](#-add-examples) +- [Auto generated help](#-auto-generated-help) - [Help option](#help-option) - [Help command](#help-command) -- [Shell completion](#shell-completion) +- [Shell completion](#-shell-completion) - [Completions command](#completions-command) - [Zsh Completions](#zsh-completions) -- [Generic options and arguments](#generic-options-and-arguments) -- [Version option](#version-option) -- [License](#license) +- [Generic options and arguments](#-generic-options-and-arguments) +- [Version option](#-version-option) +- [License](#-license) + +## ❯ Install + +This module can be imported directly from the repo and from following registries. + +Deno Registry + +```typescript +import { Command } from 'https://deno.land/x/cliffy@/command/mod.ts'; +``` + +Nest Registry + +```typescript +import { Command } from 'https://x.nest.land/cliffy@/command/mod.ts'; +``` + +Github + +```typescript +import { Command } from 'https://raw.githubusercontent.com/c4spar/deno-cliffy//command/mod.ts'; +``` -## Usage +## ❯ Usage To create a program with cliffy you can import the `Command` class from the main module `https://deno.land/x/cliffy/command/mod.ts` or directly from the command module `https://deno.land/x/cliffy/command/command.ts`. @@ -90,7 +115,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/usage.ts --help ![](assets/img/usage.png) -## Options +## ❯ Options Options are defined with the `.option()` method and can be accessed as properties on the options object which is passed to the `.action()` handler and returned by the `.parse()` method. @@ -472,7 +497,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/action-options.ts -i Some info ``` -## Commands +## ❯ Commands The command class operates as a factory class. It has an internal command pointer which point per default to the command instance itself. Each time the `.command()` method is called, the internal pointer points to the newly created command. All methods such as `.name()`, `.description()`, `.option()`, `.action()`, etc... always work on the command to which the pointer points. If you need to change the pointer back to the command instance you can call the `.reset()` method. @@ -740,7 +765,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/override-exit-handling.ts at () ``` -## Custom types +## ❯ Custom types You can register custom types with the `.type()` method. The first argument is the name of the type, the second can be either a function or an instance of `Type` and the third argument can be an options object. @@ -847,7 +872,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/global-custom-type.ts log { email: "my@email.de" } ``` -## Environment variables +## ❯ Environment variables You can define environment variables for a command that are validated when the command is executed. Environment variables are listed with the [help](#help-option-and-command) option and command. @@ -877,7 +902,7 @@ $ SOME_ENV_VAR=abc deno run --allow-env --unstable https://deno.land/x/cliffy/ex Error: Environment variable 'SOME_ENV_VAR' must be of type number but got: abc ``` -## Add examples +## ❯ Add examples You can add some examples for your command which will be printed with the [help](#help-option-and-command) option and command. @@ -896,7 +921,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/examples.ts help ![](assets/img/examples.png) -## Auto generated help +## ❯ Auto generated help The help information is auto-generated based on the information you have defined on your command's. @@ -982,7 +1007,7 @@ $ deno run https://deno.land/x/cliffy/examples/command/help-option-and-command.t $ deno run https://deno.land/x/cliffy/examples/command/help-option-and-command.ts completions help ``` -## Shell completion +## ❯ Shell completion Cliffy supports shell completion out of the box. @@ -1047,7 +1072,7 @@ To enable zsh completions on your system add the following line to your `~/.zshr source <(command-name completions zsh) ``` -## Generic options and arguments +## ❯ Generic options and arguments > This is an experimental feature and may change in the future! @@ -1080,7 +1105,7 @@ const input: string = result.args[ 0 ]; const output: string | undefined = result.args[ 1 ]; ``` -## Version option +## ❯ Version option The `--version` and `-V` option flag prints the version number defined with the `version()` method. The version number will also be printed within the output of the [help](#help-option-command) option and command. @@ -1130,10 +1155,10 @@ await new Command() .parse( Deno.args ); ``` -## Credits +## ❯ Credits Benjamin Fischer [@c4spar](https://github.com/c4spar) -## License +## ❯ License [MIT](../LICENSE) diff --git a/flags/README.md b/flags/README.md index c526b92b..6073a934 100644 --- a/flags/README.md +++ b/flags/README.md @@ -26,7 +26,37 @@ >_ Used by cliffy's command module

-## Usage +## ❯ Content + +- [Install](#-install) +- [Usage](#-usage) +- [Options](#-options) +- [Custom type processing](#-custom-type-processing) +- [License](#-license) + +## ❯ Install + +This module can be imported directly from the repo and from following registries. + +Deno Registry + +```typescript +import { parseFlags } from 'https://deno.land/x/cliffy@/flags/mod.ts'; +``` + +Nest Registry + +```typescript +import { parseFlags } from 'https://x.nest.land/cliffy@/flags/mod.ts'; +``` + +Github + +```typescript +import { parseFlags } from 'https://raw.githubusercontent.com/c4spar/deno-cliffy//flags/mod.ts'; +``` + +## ❯ Usage ```typescript import { parseFlags } from 'https://deno.land/x/cliffy/flags/mod.ts'; @@ -107,7 +137,7 @@ $ deno run https://deno.land/x/cliffy/examples/flags/options.ts -vvv -n5 -f ./ex } ``` -## Options +## ❯ Options ### parseFlags Options @@ -152,7 +182,7 @@ $ deno run https://deno.land/x/cliffy/examples/flags/options.ts -vvv -n5 -f ./ex * `OptionType.BOOLEAN` -## Custom type processing +## ❯ Custom type processing ```typescript import { parseFlags, IFlagOptions, IFlagArgument } from 'https://deno.land/x/cliffy/flags/mod.ts'; @@ -172,6 +202,6 @@ parseFlags( Deno.args, { } ); ``` -## License +## ❯ License [MIT](../LICENSE) diff --git a/keycode/README.md b/keycode/README.md index 33071cd3..6a1f5b7b 100644 --- a/keycode/README.md +++ b/keycode/README.md @@ -26,7 +26,38 @@ >_ Used by cliffy's prompt module.

-## Usage +## ❯ Content + +- [Install](#-install) +- [Usage](#-usage) +- [API](#-api) + - [KeyCode](#keycode) + - [KeyEvent](#keyevent) +- [License](#-license) + +## ❯ Install + +This module can be imported directly from the repo and from following registries. + +Deno Registry + +```typescript +import { KeyCode } from 'https://deno.land/x/cliffy@/keycode/mod.ts'; +``` + +Nest Registry + +```typescript +import { KeyCode } from 'https://x.nest.land/cliffy@/keycode/mod.ts'; +``` + +Github + +```typescript +import { KeyCode } from 'https://raw.githubusercontent.com/c4spar/deno-cliffy//keycode/mod.ts'; +``` + +## ❯ Usage ```typescript import { KeyCode } from 'https://deno.land/x/cliffy/keycode/mod.ts'; @@ -66,7 +97,7 @@ await read(); $ deno run --unstable https://deno.land/x/cliffy/examples/keycode/read-key.ts ``` -## Documentation +## ❯ API ### KeyCode @@ -80,6 +111,6 @@ $ deno run --unstable https://deno.land/x/cliffy/examples/keycode/read-key.ts * meta: boolean * shift: boolean -## License +## ❯ License [MIT](../../LICENSE) diff --git a/prompt/README.md b/prompt/README.md index 98a4536b..7f74e3b9 100644 --- a/prompt/README.md +++ b/prompt/README.md @@ -31,14 +31,15 @@ ## ❯ Content -* [Install](#-install) -* [Usage](#-usage) - * [Single Prompt](#single-prompt) - * [Prompt List](#prompt-list) - * [Dynamic Prompts](#dynamic-prompts) - * [Custom Prompts](#custom-prompts) -* [API](#-api) -* [Types](#-types) +- [Install](#-install) +- [Usage](#-usage) + - [Single Prompt](#single-prompt) + - [Prompt List](#prompt-list) + - [Dynamic Prompts](#dynamic-prompts) + - [Custom Prompts](#custom-prompts) +- [API](#-api) +- [Types](#-types) +- [License](#-license) ## ❯ Install @@ -577,6 +578,6 @@ The `Checkbox` prompt has all [base options](#base-options) and the following pr **↑ back to:** [Prompt types](#-types) -## License +## ❯ License [MIT](../LICENSE) diff --git a/table/README.md b/table/README.md index dff51e08..cdc46a21 100644 --- a/table/README.md +++ b/table/README.md @@ -31,47 +31,16 @@ ## ❯ Content -* [Install](#-install) -* [Usage](#-usage) - * [Basic Usage](#basic-usage) - * [Using as Array](#using-as-array) - * [Header and Body](#header-and-body) - * [Table Options](#table-options) - * [Row's and Cell's](#rows-and-cells) - * [Colspan and Rowspan](#colspan-and-rowspan) -* [API](#-api) - * [Table](#table) - * [.header(row)](#headerrow) - * [.body(rows)](#bodyrows) - * [.clone()](#clone) - * [.toString()](#tostring) - * [.render()](#render) - * [.minColWidth(width,override)](#mincolwidthwidthoverride) - * [.maxColWidth(width,override)](#maxcolwidthwidthoverride) - * [.indent(width,override)](#indentwidthoverride) - * [.padding(padding,override)](#paddingpaddingoverride) - * [.border(enable,override)](#borderenableoverride) - * [.chars(chars)](#charschars) - * [.getHeader()](#getheader) - * [.getBody()](#getbody) - * [.getMinColWidth()](#getmincolwidth) - * [.getMaxColWidth()](#getmaxcolwidth) - * [.getIndent()](#getindent) - * [.getPadding()](#getpadding) - * [.getBorder()](#getborder) - * [Row](#row) - * [.clone()](#clone-1) - * [.border(enable,override)](#borderenableoverride-1) - * [.getBorder()](#getborder-1) - * [Cell](#cell) - * [.clone()](#clone-2) - * [.border(enable,override)](#borderenableoverride-2) - * [.colSpan(span,override)](#colspanspanoverride) - * [.rowSpan(span,override)](#rowspanspanoverride) - * [.getBorder()](#getborder-2) - * [.getColSpan()](#getcolspan) - * [.getRowSpan()](#getrowspan) -* [License](#-license) +- [Install](#-install) +- [Usage](#-usage) + - [Basic Usage](#basic-usage) + - [Using as Array](#using-as-array) + - [Header and Body](#header-and-body) + - [Table Options](#table-options) + - [Row's and Cell's](#rows-and-cells) + - [Colspan and Rowspan](#colspan-and-rowspan) +- [API](#-api) +- [License](#-license) ## ❯ Install @@ -235,6 +204,38 @@ $ deno run https://deno.land/x/cliffy/examples/table/colspan-and-rowspan.ts ## ❯ API +- [Table](#table) + - [.header(row)](#headerrow) + - [.body(rows)](#bodyrows) + - [.clone()](#clone) + - [.toString()](#tostring) + - [.render()](#render) + - [.minColWidth(width,override)](#mincolwidthwidthoverride) + - [.maxColWidth(width,override)](#maxcolwidthwidthoverride) + - [.indent(width,override)](#indentwidthoverride) + - [.padding(padding,override)](#paddingpaddingoverride) + - [.border(enable,override)](#borderenableoverride) + - [.chars(chars)](#charschars) + - [.getHeader()](#getheader) + - [.getBody()](#getbody) + - [.getMinColWidth()](#getmincolwidth) + - [.getMaxColWidth()](#getmaxcolwidth) + - [.getIndent()](#getindent) + - [.getPadding()](#getpadding) + - [.getBorder()](#getborder) +- [Row](#row) + - [.clone()](#clone-1) + - [.border(enable,override)](#borderenableoverride-1) + - [.getBorder()](#getborder-1) +- [Cell](#cell) + - [.clone()](#clone-2) + - [.border(enable,override)](#borderenableoverride-2) + - [.colSpan(span,override)](#colspanspanoverride) + - [.rowSpan(span,override)](#rowspanspanoverride) + - [.getBorder()](#getborder-2) + - [.getColSpan()](#getcolspan) + - [.getRowSpan()](#getrowspan) + ### Table #### .header(row)