#!/usr/bin/env node import { ReadmeBlock } from './readme'; import { DocLinksParams, EnvDocs, ScriptDocs } from './types'; /** * Defines known headers that we will parse * @remarks * `STRING` is for inserting new sections. `FIELD` is regex for matching sections. * @public */ export declare const HEADERS: { FIRST: { RE: RegExp; }; TOC: { STRING: string; RE: RegExp; }; LICENSE: { STRING: string; RE: RegExp; }; GETTING_STARTED: { STRING: string; RE: RegExp; }; SCRIPTS: { STRING: string; RE: RegExp; }; ENV: { STRING: string; RE: RegExp; }; }; /** * For each documented script in package.json, create documentation in README * @param docs - a {@link ScriptDocs} object containing documentation objects describing * package.json scripts. * @public * @returns a {@link ReadmeBlock} whose content is a formatted {@link ScriptDocs}. */ export declare const formatScriptDocs: (docs: ScriptDocs) => ReadmeBlock; /** * For each documented environment variable in package.json, create documentation in README * @param docs - a {@link EnvDocs} object containing documentation objects describing environment variables. * @public * @returns a {@link ReadmeBlock} whose content is a formatted {@link EnvDocs}. */ export declare const formatEnvDocs: (docs: EnvDocs) => ReadmeBlock; /** * Iterates over all the markdown files in the project to build a tree of links to each document * @param params - {@link DocLinksParams} a doc links section header, an introductory paragraph, and a path to the repository. * @public * @returns a {@link ReadmeBlock} of relative links to the documents in the standardized documentation path */ export declare function buildDocumentationLinksBlock({ header, introduction, }: DocLinksParams): ReadmeBlock; /** * Normalizes all documentation in the project. * @param content - readme text content. * @param title - name of the H1 header * @param scriptDocs - a {@link ScriptDocs} object containing documentation on package.json scripts. * @param envDocs - a {@link EnvDocs} object containing documentation for environment variables * @param repoRoot - the name of the repository, used as a fallback for the top-level readme header if it's missing. * @public * @returns an exported {@link Readme} instance. */ export declare function standardize(content: string, title: string, scriptDocs?: ScriptDocs, envDocs?: EnvDocs, repoRoot?: string): string; /** * Reads the package.json and README.md files, and generates a standardized {@link Readme}, exports it and writes to disk. * @public */ export declare function main(): Promise; //# sourceMappingURL=standardizeReadme.d.ts.map