1.0.0 • Published 6 years ago

markdown-shell-script v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

markdown-shell-script

Transforms shell commands and code snippets from a markdown file into a shell script

## Installation

yarn add markdown-shell-script or npm install markdown-shell-script

## Usage

const markdownShellScript = require("markdown-shell-script");

markdownShellScript(`
# Markdown example

\`\`\`bash
# Go to root folder
cd ~
# Create hello-world directory
mkdir hello-world
\`\`\`

\`\`\`js {hello-world/greeting.js}
console.log("Hello world")
\`\`\`

\`\`\`bash
node hello-world/greeting.js
\`\`\`
`).then(console.log)

/*
#! /bin/sh

# Go to root folder
cd ~
# Create hello-world directory
mkdir hello-world

cat > hello-world/greeting.js << 'EOF'
console.log("Hello world")
EOF

node hello-world/greeting.js
*/