2.0.0 • Published 3 months ago

madcut v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

🎬 MadCut License NPM version Build Status Coverage Status

CLI tool to cut markdown into peaces. Based on 🐊Putout code transformer.

Install

npm i madcut

CLI

Just run 🎬MadCut, it will read README.md and write peaces according to their headings to files. Generally names converted to kebab form: ## Hello world will be converted to file name hello-world.md.

$ madcut

API

madcut(markdown);

Infer captions to a list.

import madcut from 'madcut';
import montag from 'montag';

await madcut(montag`
    # Hello
    ## World
`);

// returns
({
    index: '# Hello\n',
    world: '## World\n',
});

cut(markdown)

Cut markdown file into a peaces list.

import {cut} from 'madcut';
import montag from 'montag';

await cut(montag`
    # Hello
    
    ## World
    
    This is the world
`);

// returns
[
    montag`
        # Hello\n\n
    `,
    montag`
        ## World
        
        This is the world\n
    `,
];

infer(markdown);

Infer captions to a list.

import {infer} from 'madcut';
import montag from 'montag';

await infer(montag`
    # Hello
    ## World
`);

// returns
['World'];

License

MIT

2.0.0

3 months ago

1.4.1

8 months ago

1.4.0

10 months ago

1.3.0

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago