text-embed

1.0.0 • Public • Published

Text embed

Intro

Super simple embeding of lines from one document into another. Something like an iframe for markdown.

Usage

Given a "parent" file./test/input.md:

Tester
 
A simple markdown file
 
* Demonstrate
* Test
 
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
--text-embed:test/i-see-stars.txt::lines:3-4
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

and an embed source ./test/i-see-stars.txt:

 
*******************
**Test successful**
*                 *

You can invoke this module, to grab the specified lines, from the specified file and combine it with the host to create a new output file:

node src/index.js ./test/input.md ./dist/output.md '--text-embed:'

and you will end up with ./dist/output.md:

Tester
 
A simple markdown file
 
* Demonstrate
* Test
 
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
**Test successful**
*                 *
↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

Readme

Keywords

none

Package Sidebar

Install

npm i text-embed

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • ashcoolman