HelpDoc
Combinators
Signature
declare const orElse: { (that: HelpDoc): (self: HelpDoc) => HelpDoc; (self: HelpDoc, that: HelpDoc): HelpDoc;}Signature
declare const sequence: { (that: HelpDoc): (self: HelpDoc) => HelpDoc; (self: HelpDoc, that: HelpDoc): HelpDoc;}Constructors
Signature
declare const blocks: (helpDocs: Iterable<HelpDoc>) => HelpDocdescriptionList
Added in v1.0.0
Source
Signature
declare const descriptionList: (definitions: NonEmptyReadonlyArray<[Span, HelpDoc]>) => HelpDocSignature
declare const empty: HelpDocenumeration
Added in v1.0.0
Source
Signature
declare const enumeration: (elements: NonEmptyReadonlyArray<HelpDoc>) => HelpDocSignature
declare const h1: (value: string | Span) => HelpDocSignature
declare const h2: (value: string | Span) => HelpDocSignature
declare const h3: (value: string | Span) => HelpDocSignature
declare const p: (value: string | Span) => HelpDocGetters
Mapping
mapDescriptionList
Added in v1.0.0
Source
Signature
declare const mapDescriptionList: { (f: (span: Span, helpDoc: HelpDoc) => [Span, HelpDoc]): (self: HelpDoc) => HelpDoc; (self: HelpDoc, f: (span: Span, helpDoc: HelpDoc) => [Span, HelpDoc]): HelpDoc;}Models
DescriptionList interface
Added in v1.0.0
Source
Signature
interface DescriptionList { readonly _tag: "DescriptionList"; readonly definitions: readonly [readonly [Span, HelpDoc], readonly [Span, HelpDoc]];}Signature
interface Empty { readonly _tag: "Empty";}Enumeration interface
Added in v1.0.0
Source
Signature
interface Enumeration { readonly _tag: "Enumeration"; readonly elements: readonly [HelpDoc, HelpDoc];}Signature
interface Header { readonly _tag: "Header"; readonly level: number; readonly value: Span;}A HelpDoc models the full documentation for a command-line application.
HelpDoc is composed of optional header and footers, and in-between, a
list of HelpDoc-level content items.
HelpDoc-level content items, in turn, can be headers, paragraphs, description lists, and enumerations.
A HelpDoc can be converted into plaintext, JSON, and HTML.
Signature
type HelpDoc = Empty | Header | Paragraph | DescriptionList | Enumeration | SequenceSignature
interface Paragraph { readonly _tag: "Paragraph"; readonly value: Span;}Signature
interface Sequence { readonly _tag: "Sequence"; readonly left: HelpDoc; readonly right: HelpDoc;}Refinements
isDescriptionList
Added in v1.0.0
Source
Signature
declare const isDescriptionList: (helpDoc: HelpDoc) => helpDoc is DescriptionListSignature
declare const isEmpty: (helpDoc: HelpDoc) => helpDoc is EmptyisEnumeration
Added in v1.0.0
Source
Signature
declare const isEnumeration: (helpDoc: HelpDoc) => helpDoc is EnumerationSignature
declare const isHeader: (helpDoc: HelpDoc) => helpDoc is HeaderisParagraph
Added in v1.0.0
Source
Signature
declare const isParagraph: (helpDoc: HelpDoc) => helpDoc is ParagraphisSequence
Added in v1.0.0
Source
Signature
declare const isSequence: (helpDoc: HelpDoc) => helpDoc is SequenceRendering
Signature
declare const toAnsiDoc: (self: HelpDoc) => AnsiDoctoAnsiText
Added in v1.0.0
Source
Signature
declare const toAnsiText: (self: HelpDoc) => string