Skip to content

stevenbenisek/markdown-magic-local-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

markdown-magic-local-image

Build Status

Markdown Magic plugin to add local images to markdown.

Install

npm install --save-dev markdown-magic-local-image

Usage

Example

markdown.config.js

module.exports = {
  transforms: {
    LOCALIMAGE: require('markdown-magic-local-image'),
  },
};

README.md

<!-- AUTO-GENERATED-CONTENT:START (LOCALIMAGE:heading=true&headingLevel=4&include=src/*.svg) -->

<!-- AUTO-GENERATED-CONTENT:END -->

Given a folder of svg's:

  • src/add.svg
  • src/close.svg
  • src/home.svg

Yields:

README.md

<!-- AUTO-GENERATED-CONTENT:START (LOCALIMAGE:heading=true&headingLevel=4&include=src/*.svg) -->

#### add

![Alt text](src/add.svg "add")

#### close

![Alt text](src/close.svg "close")

#### home

![Alt text](src/home.svg "home")

<!-- AUTO-GENERATED-CONTENT:END -->

Options

heading

boolean: defaults to true

Add a heading, based on the filename, before each image.

headingLevel

number: defaults to 6

Control the heading level.

include

string: defaults to './**/*.{gif,jpg,png,svg}'.

Glob pattern as supported by https://github.com/isaacs/node-glob.

About

Markdown Magic plugin to add local images to markdown

Resources

License

Stars

Watchers

Forks

Packages

No packages published