Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

mdinject

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdinject

Inject other files into Markdown

latest
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

mdinject

This command line utility lets you inject arbitrary files into your markdown (or any other file type) using a simple syntax. This is useful for including snippets in your README extracted from your tests helping to ensure their accuracy and maintenance. This very file is built using it! 🐶🥫

Featureset

  • Any language, any file
  • Relative indentation
  • Inject specific sections of a file
  • Inject multiple files

Usage

See the examples folder.

In Markdown (or other file)

md​inject '<file>' '<tag>'

Including the above will inject the tag section from file. Files are resolved relative to the markdown file. The entire line that this statement appears on will be overwritten so you can use whatever additional syntax you like e.g. comments.

In referenced files

mdinject-start <tag> mdinject-end <tag>

Lines between those two statements will be considered the content for tag and will be included when the file and tag are referenced. The line can have other characters than that syntax so you can place it in whatever comment syntax you prefer.

CLI

mdinject <file>

This will read the given file (typically a Markdown file) and replace the mdinject statements with the prescribed file contents. The results will be written to stdout.

Options

  • --eol=<string> Provide an alternate EOL string, by default mdinject detects the line endings of the inputted file
  • --trim=<boolean> Enable/disable the relative indentation trim functionality. Default is true.

FAQs

Package last updated on 09 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts