https://github.com/scil/mdsplit-js
https://github.com/scil/mdsplit-js
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/scil/mdsplit-js
- Owner: scil
- License: mit
- Created: 2023-12-21T15:35:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-23T11:10:23.000Z (over 1 year ago)
- Last Synced: 2025-02-23T12:20:01.721Z (5 months ago)
- Language: JavaScript
- Size: 143 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# [mdsplit-js](https://github.com/scil/mdsplit-js)
[](https://github.com/yanhaijing/jslib-base)
[](https://github.com/scil/mdsplit-js/blob/master/LICENSE)
[](https://github.com/scil/mdsplit-js/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/mdsplit-js)
[](http://www.npmtrends.com/mdsplit-js)
[](http://isitmaintained.com/project/scil/mdsplit-js "Percentage of issues still open")js port of python [markusstraub/mdsplit](https://github.com/markusstraub/mdsplit)
## Extra Features
1. customize the file name for each chapter (each head represents a chapter). Index can be added to file name
```bash
-cf "return `${chapter.index}-${( chapter.heading? chapter.heading.headingTitle: fallback )}` " -o output_dir "big.md"
```2. new treatment method for the text contents under a header which has sub headers
```markdown
# h1history
## h2
```
by default, this markdown file would be split into
```
- h1.md
- h1
- h2.md
```
but with the extra cli option `-eq`, the output is
```
- h1
- h1.md
- h2.md
```
with both options `-eq` and `-cf`
```bash
-eq -cf "return `${chapter.index}-${( chapter.heading? chapter.heading.headingTitle: fallback )}` " -l 2 -o output_dir "big.md"
```
the output could be
```
- 0-h1
- 0-h1.md
- 1-h2.md
```