Have ideas to improve npm?Join in the discussion! »

    markdown-source-import
    TypeScript icon, indicating that this package has built-in type declarations

    1.3.1 • Public • Published

    Markdown Source Import

    Build Status Coverage Status

    Preview

    Install

    npm install markdown-source-import --save-dev

    Basic

    Title
     
    <!-- import __stories__/test.stories.tsx -->
    <!-- importend -->
     
    <!-- index __documents__/*.md -->
    <!-- indexend -->

    Add comment to markdown documents.

    npx markdown-source-import file.md
    npx markdown-source-import file1.md file2.md file3.md 
    npx markdown-source-import ./**/*.md

    Execute markdown-source-import [file] command.

    Import Parameters

    • <!-- import **/*.test.ts --> import multiple source files with glob pattern
    • <!-- import test.tsx --slice 40:60 --> line slice option
    • <!-- import **/*.test.ts --title-tag h4 --> add filename above code block

    Index Parameters

    • <!-- index **/*.md --> create indexes with glob pattern

    Git Hook

    {
      "husky": {
        "hooks": {
          "pre-commit": "markdown-source-import \"{,!(node_modules)/**/}*.md\" --git-add"
        }
      }
    }

    Add markdown-source-import \"{,!(node_modules)/**/}*.md\" --git-add command in pre-commit hook.

    The "{,!(node_modules)/**/}*.md" glob pattern will process all *.md files except node_modules directory. (eg. "{,!(dir1|dir2|dir3)/**/}*.md")

    Keywords

    Install

    npm i markdown-source-import

    DownloadsWeekly Downloads

    46

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    25.1 kB

    Total Files

    28

    Last publish

    Collaborators

    • avatar