Gathering detailed insights and metrics for @aaronhuggins/concat-md
Gathering detailed insights and metrics for @aaronhuggins/concat-md
Gathering detailed insights and metrics for @aaronhuggins/concat-md
Gathering detailed insights and metrics for @aaronhuggins/concat-md
CLI and API to concatenate markdown files and modify as necessary.
npm install @aaronhuggins/concat-md
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (66.38%)
JavaScript (33.62%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
28 Commits
9 Branches
1 Contributors
Updated on Oct 28, 2021
Latest Version
0.3.9
Package Id
@aaronhuggins/concat-md@0.3.9
Unpacked Size
38.57 kB
Size
10.19 kB
File Count
9
NPM Version
6.14.13
Node Version
14.17.3
Published on
Nov 02, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
9
22
CLI and API to concatenate markdown files and modify as necessary.
# Install
$ npm install -g concat-md
or use it via npx
:
$ npx concat-md docs
If files have titles in markdown already:
$ concat-md --toc --decrease-title-levels --dir-name-as-title typedoc-api-docs > README.md
If files have titles in FrontMatter meta data:
$ concat-md --toc --decrease-title-levels --title-key title --file-name-as-title --dir-name-as-title docs > README.md
If files don't have titles:
$ concat-md --toc --decrease-title-levels --file-name-as-title --dir-name-as-title docs > README.md
FrontMatter
, file names and directory names,<a name=""></a>
) to files, if no optional titles are generated.1Usage 2 $ concat-md [options] <dir> 3 4Options 5 --ignore <globs csv> - Glob patterns to exclude in 'dir'. 6 --toc - Adds table of the contents at the beginning of file. 7 --decrease-title-levels - Whether to decrease levels of all titles in markdown file to set them below file and directory title levels. 8 --start-title-level-at <level no> - Level to start file and directory levels. Default: 1 9 --join-string <string> - String to be used to join concatenated files. Default: new line 10 --title-key <key name> - Key name to get title in 'FrontMatter' meta data in markdown headers. 11 --file-name-as-title - Whether to use file names as titles. 12 --dir-name-as-title - Whether to use directory names as titles. 13 --debug - Print stack trace in errors. 14 15Examples 16 If files have titles in markdown already: 17 $ npx concat-md --toc --decrease-title-levels --dir-name-as-title typedoc-api-docs > README.md 18 19 If files have titles in FrontMatter meta data: 20 $ npx concat-md --toc --decrease-title-levels --title-key title --file-name-as-title --dir-name-as-title docs > README.md 21 22 If files don't have titles: 23 $ npx concat-md --toc --decrease-title-levels --file-name-as-title --dir-name-as-title docs > README.md
└─ Development
└─ Projects
└─ project-a
├─ docs
├─ classes
│ ├─ widget.md
│ ├─ utility.md
└─ interfaces
└─ screen.md
classes/widget.md
1# Description 2 3Widget details lorem ipsum...
classes/utility.md
1# Description 2 3Utility details lorem ipsum...
interfaces/screen.md
1# Description 2 3Screen details lorem ipsum...
1$ md-merge --decrease-title-levels --file-name-as-title --dir-name-as-title docs > README.md
Above command;
Description
titles,README.md
as below:README.md
1# Classes 2 3## Widget 4 5### Description 6 7Widget details lorem ipsum... 8 9## Utility 10 11### Description 12 13Utility details lorem ipsum... 14 15# Interfaces 16 17## Screen 18 19### Description 20 21Screen details lorem ipsum...
▸ concatMd(dir
: string, options?
: ConcatOptions): Promise<string>
Defined in index.ts:295
Scans and concatenates all markdown files in given directory.
1import concatMd, { concatMdSync } from "concat-md";
Parameters:
Name | Type | Description |
---|---|---|
dir | string | is the directory to scan markdown files in. |
options? | ConcatOptions | are several parameters to modify concatenation behaviour. |
Returns: Promise<string>
concatenated contents of markdown files.
▸ concatMdSync(dir
: string, options?
: ConcatOptions): string
Defined in index.ts:281
Scans and concatenates all markdown files in given directory.
1import concatMd, { concatMdSync } from "concat-md";
Parameters:
Name | Type | Description |
---|---|---|
dir | string | is the directory to scan markdown files in. |
options? | ConcatOptions | are several parameters to modify concatenation behaviour. |
Returns: string
concatenated contents of markdown files.
Concat function options.
Optional
decreaseTitleLevels• decreaseTitleLevels? : undefined | false | true
Defined in index.ts:52
Whether to decrease levels of all titles in markdown file to set them below file and directory title levels.
Optional
dirNameAsTitle• dirNameAsTitle? : undefined | false | true
Defined in index.ts:72
Whether to use directory names as titles.
Optional
fileNameAsTitle• fileNameAsTitle? : undefined | false | true
Defined in index.ts:68
Whether to use file names as titles.
Optional
ignore• ignore? : string | string[]
Defined in index.ts:48
Glob patterns to exclude in dir
.
Optional
joinString• joinString? : undefined | string
Defined in index.ts:60
String to be used to join concatenated files.
Optional
startTitleLevelAt• startTitleLevelAt? : undefined | number
Defined in index.ts:56
Level to start file and directory levels.
Optional
titleKey• titleKey? : undefined | string
Defined in index.ts:64
Key name to get title in FrontMatter
meta data in markdown headers.
Optional
toc• toc? : undefined | false | true
Defined in index.ts:40
Whether to add a table of contents.
Optional
tocLevel• tocLevel? : undefined | number
Defined in index.ts:44
Limit TOC entries to headings only up to the specified level.
No vulnerabilities found.
No security vulnerabilities found.