Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/accraze/split-md
:wavy_dash: Split a Markdown file into smaller files
https://github.com/accraze/split-md
cli delimiter markdown markdown-parser smaller-files
Last synced: 19 days ago
JSON representation
:wavy_dash: Split a Markdown file into smaller files
- Host: GitHub
- URL: https://github.com/accraze/split-md
- Owner: accraze
- License: mit
- Created: 2016-01-31T04:20:35.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-12T05:14:26.000Z (over 5 years ago)
- Last Synced: 2024-10-12T11:14:55.572Z (about 1 month ago)
- Topics: cli, delimiter, markdown, markdown-parser, smaller-files
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/split-md
- Size: 34.2 KB
- Stars: 23
- Watchers: 3
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![travis build](https://img.shields.io/travis/accraze/split-md.svg)](https://travis-ci.org/accraze/split-md)
[![version](https://img.shields.io/npm/v/split-md.svg)](https://www.npmjs.com/package/split-md)
[![license](https://img.shields.io/npm/l/split-md.svg)](https://www.npmjs.com/package/split-md)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)# split-md
NodeJS CLI that splits a Markdown file into smaller files based on a given delimiter. It's basically `str.split(pattern)` for `.md` files.
## Install
```
$ npm install split-md
```## Useage
To use the CLI, type `split-md` followed by it's args:
* readPath (path to larger .md file)
* pattern (string)
* cleanName (string): do you want to remove anything from the pattern?
* writePath (path to where smaller files should be created)
* limit (optionally limit the number of files created)
* hasCounter (optionally have the outputted files names be numbered)#### Example
```
$ split-md 'tests/testdata.md' '### v' '###' '' 10 true
```In the above example we are reading in `tests/testdata.md`. Our delimiter is whenever we see a line start with the pattern `### v`. We want to use this line for our new markdown file's name, however we want to remove the `###` by setting it as the cleanName variable. Next, we are setting the `writePath` to our current working directory by giving an empty string as this variable. Also note that we are setting our limit to only create 10 files before exiting. Lastly, we have `true` to show that we want the file names to be ordered.
## License:
[MIT](https://github.com/accraze/split-md/blob/master/LICENSE) License 2016-2018 © Andy Craze & contributors