Detalhes do pacote

madcut

coderaiser328MIT2.0.0

CLI tool to cut markdown file in a madly comfortable way

madcut, markdown, cut, tool

readme (leia-me)

🎬 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

changelog (log de mudanças)

2024.01.29, v2.0.0

feature:

  • b5fde27 madcut: putout v35.0.1
  • 0ac5670 madcut: @putout/processor-markdown v12.0.0
  • 4c8b738 madcut: mock-import v4.0.2
  • 29b3660 madcut: drop support of node < 18
  • fa7b91c madcut: escover v4.0.1
  • 6f52a74 madcut: putout v34.0.9
  • 4f617e1 madcut: supertape v9.0.0
  • a41607a madcut: madrun v10.0.0
  • 6b758ff madcut: @putout/processor-markdown v11.0.0
  • 9d3fb0f madcut: eslint-plugin-putout v22.1.0

2023.09.15, v1.4.1

feature:

  • 81904ed package: @putout/processor-markdown v10.1.0
  • 3de6b4b package: putout v32.0.4
  • d8720ed package: eslint-plugin-putout v19.0.3
  • 23ac710 package: putout v31.0.4
  • 78596f6 package: nodemon v3.0.1

2023.07.09, v1.4.0

feature:

  • 29b5083 package: putout v30.2.0
  • 036bed9 package: mock-import v3.2.0
  • 3651d52 package: eslint-plugin-putout v18.0.0
  • 79d3979 package: eslint-plugin-n v16.0.1
  • cadfe8d package: escover v3.4.0
  • cfe148a package: @putout/processor-markdown v9.0.1

2023.01.06, v1.3.0

fix:

  • madcut: plugin: text -> paragraph

feature:

  • package: supertape v8.2.0
  • package: putout v28.3.0

2022.10.20, v1.2.1

feature:

  • package: putout v28.0.0

2022.08.07, v1.2.0

feature:

  • madcut: cli: read files, save results

2022.08.07, v1.1.0

feature:

  • madcut: increase accuracy of the cut