Skip to content

schacon/markdownDrop

Repository files navigation

MarkdownDrop README

This is a very simple VSCode extension that allows you to drag and drop files into a Markdown document, which uploads them into an S3 bucket and inserts that URL as the image.

Setup

You need to have a ~/.markdowndrop.json file with the following structure:

{"endpoint": "https://s3.us-east-1.amazonaws.com", "region": "us-east-1", "bucketName": "your-bucket-name", "accessKeyId": "your-access-key-id", "secretAccessKey": "your-secret-access-key", "cdn": "https://${bucket}.${region}.s3.amazonaws.com/${pathname}/${filepath}", "imageTagTemplate": "<ImageSection className=\"mx-auto\" src=\"${url}\" subtitle=\"${filename}\" />"# (optional - defaults to markdown syntax) }

By default it will insert normal markdown syntax, but if you want something else, you can add the "imageTagTemplate" with optional $url and $filename variables. The example above will insert a custom React component.

Usage

Drag and drop a file into a Markdown document. It's important to hold down the shift key while dropping the file, otherwise VSCode will simply open the image.

License

This project is licensed under the MIT License. See the LICENSE file for details

About

drop images onto markdown files to get urls from S3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published