ts-markdown
Version:
An extensible TypeScript markdown generator that takes JSON and creates a markdown document.
41 lines (40 loc) • 1.24 kB
TypeScript
import { MarkdownRenderer } from '../rendering.types';
import { InlineTypes, MarkdownEntry } from '../shared.types';
/**
* A markdown entry for generating h1 elements.
*/
export interface H1Entry extends MarkdownEntry {
/**
* The h1 contents and identifying property for the renderer.
*/
h1: InlineTypes;
/**
* Option which will use '=' underlining rather than a '#' prefix.
*/
underline?: boolean;
/**
* Option which will append a markdown heading ID.
* E.g., given the ID 'my-id' and the header 'Header Example',
* `# Header Example {#my-id}`
*/
id?: string;
/**
* Option which will arbitrarily append a string immediately below the h1, ignoring block-level settings.
*/
append?: string;
}
/**
* The renderer for h1 entries.
*
* @param entry The h1 entry.
* @param options Document-level render options.
* @returns Block-level h1 markdown content.
*/
export declare const h1Renderer: MarkdownRenderer;
/**
* Helper which creates a first-level header entry.
*
* @param options Entry-level options for this element.
* @returns a first-level header entry
*/
export declare function h1(content: H1Entry['h1'], options?: Omit<H1Entry, 'h1'>): H1Entry;