UNPKG

ts-markdown

Version:

An extensible TypeScript markdown generator that takes JSON and creates a markdown document.

54 lines (53 loc) 1.52 kB
import { MarkdownRenderer } from '../rendering.types'; import { MarkdownEntry, InlineTypes } from '../shared.types'; /** * A markdown entry for generating description lists. */ export interface DescriptionListEntry extends MarkdownEntry { /** * The description list contents and identifying property for the renderer. */ dl: (DescriptionTerm | DescriptionDetails)[]; /** * Indicates whether to use HTML to render the entry. * Default: false */ html?: boolean; /** * Option which will arbitrarily append a string immediately below the dl, ignoring block-level settings. */ append?: string; } /** * A description term field. */ export declare type DescriptionTerm = { /** * The content of the description term. */ dt: InlineTypes; }; /** * A description details field. */ export declare type DescriptionDetails = { /** * The content of the details. */ dd: InlineTypes; }; /** * The renderer for descriptions list entries. * * @param entry The description list entry. * @param options Document-level render options. * @returns Block-level description list markdown content. */ export declare const dlRenderer: MarkdownRenderer; /** * Helper which creates a description list entry. * * @param options Entry-level options for this element. * @returns a description list entry */ export declare function dl(content: DescriptionListEntry['dl'], options?: Omit<DescriptionListEntry, 'dl'>): DescriptionListEntry;