concat-md

  • Version 0.5.1
  • Published
  • 39.2 kB
  • 6 dependencies
  • MIT license

Install

npm i concat-md
yarn add concat-md
pnpm add concat-md

Overview

CLI and API to concatenate markdown files and modify as necessary.

Index

Functions

function concatMd

concatMd: (dir: string, options?: ConcatOptions) => Promise<string>;
  • Scans and concatenates all markdown files in given directory.

    Parameter dir

    is the directory to scan markdown files in.

    Parameter options

    are several parameters to modify concatenation behaviour.

    Returns

    concatenated contents of markdown files.

    Example 1

    import concatMd, { concatMdSync } from "concat-md"

function concatMdSync

concatMdSync: (dir: string, options?: ConcatOptions) => string;
  • Scans and concatenates all markdown files in given directory.

    Parameter dir

    is the directory to scan markdown files in.

    Parameter options

    are several parameters to modify concatenation behaviour.

    Returns

    concatenated contents of markdown files.

    Example 1

    import concatMd, { concatMdSync } from "concat-md"

gitHubLink: (val: string) => string;

Interfaces

interface ConcatOptions

interface ConcatOptions {}
  • Concat function options.

property decreaseTitleLevels

decreaseTitleLevels?: boolean;
  • Whether to decrease levels of all titles in markdown file to set them below file and directory title levels.

property dirNameAsTitle

dirNameAsTitle?: boolean;
  • Whether to use directory names as titles.

property fileNameAsTitle

fileNameAsTitle?: boolean;
  • Whether to use file names as titles.

hideAnchorLinks?: boolean;
  • Do not add anchor links

property ignore

ignore?: string | string[];
  • Glob patterns to exclude in dir.

property joinString

joinString?: string;
  • String to be used to join concatenated files.

property sorter

sorter?: (a: string, b: string) => number;
  • Custom sort function. If not set, files are sorted alphabetically.

property startTitleLevelAt

startTitleLevelAt?: number;
  • Level to start file and directory levels.

property titleKey

titleKey?: string;
  • Key name to get title in FrontMatter meta data in markdown headers.

property toc

toc?: boolean;
  • Whether to add a table of contents.

property tocLevel

tocLevel?: number;
  • Limit TOC entries to headings only up to the specified level.

Package Files (1)

Dependencies (6)

Dev Dependencies (21)

Peer Dependencies (0)

No peer dependencies.

Badge

To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/concat-md.

  • Markdown
    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/concat-md)
  • HTML
    <a href="https://www.jsdocs.io/package/concat-md"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>