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>) => HelpDoc;descriptionList
Added in v1.0.0
Source
Signature
declare const descriptionList: (definitions: NonEmptyReadonlyArray<[Span, HelpDoc]>) => HelpDoc;Signature
declare const empty: HelpDoc;enumeration
Added in v1.0.0
Source
Signature
declare const enumeration: (elements: NonEmptyReadonlyArray<HelpDoc>) => HelpDoc;Signature
declare const h1: (value: string | Span) => HelpDoc;Signature
declare const h2: (value: string | Span) => HelpDoc;Signature
declare const h3: (value: string | Span) => HelpDoc;Signature
declare const p: (value: string | Span) => HelpDoc;Getters
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;
}Signature
type HelpDoc = Empty | Header | Paragraph | DescriptionList | Enumeration | Sequence;Signature
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 DescriptionList;Signature
declare const isEmpty: (helpDoc: HelpDoc) => helpDoc is Empty;isEnumeration
Added in v1.0.0
Source
Signature
declare const isEnumeration: (helpDoc: HelpDoc) => helpDoc is Enumeration;Signature
declare const isHeader: (helpDoc: HelpDoc) => helpDoc is Header;isParagraph
Added in v1.0.0
Source
Signature
declare const isParagraph: (helpDoc: HelpDoc) => helpDoc is Paragraph;isSequence
Added in v1.0.0
Source
Signature
declare const isSequence: (helpDoc: HelpDoc) => helpDoc is Sequence;Rendering
Signature
declare const toAnsiDoc: (self: HelpDoc) => AnsiDoc;toAnsiText
Added in v1.0.0
Source
Signature
declare const toAnsiText: (self: HelpDoc) => string;
A
HelpDocmodels the full documentation for a command-line application.HelpDocis 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
HelpDoccan be converted into plaintext, JSON, and HTML.