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"
function gitHubLink
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.
property hideAnchorLinks
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)
- @types/jest
- @types/lodash.startcase
- @types/node
- @types/prettier
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- eslint
- eslint-config-airbnb-base
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jest
- eslint-plugin-prettier
- jest
- npm-run-all
- prettier
- ts-jest
- ts-node-dev
- typedoc
- typedoc-plugin-example-tag
- typedoc-plugin-markdown
- typescript
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto 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[](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>
- Updated .
Package analyzed in 909 ms. - Missing or incorrect documentation? Open an issue for this package.