• Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy to insert a image to markdown

English Readme / 简体中文说明 / 繁體中文說明

Markdown Image

An extension for conveniently inserting pictures in Markdown, which supports storing pictures in local or third-party CDN service.

Sponsor me / 赞助开发者

Features

  1. Copy image files or paste screenshots, Shortcut key Alt + Shift + V, or right-click menu Paste Image.
  2. Automatically generate Markdown code insertion.
  3. Configurable to support Imgur, Qiniu, SM.MS, Coding, Cloudinary and other CDN service. The default is local, you need to open the folder where the Markdown file is located.
  4. You can also customize the code to upload pictures.
  5. Support Windows, MacOS, Linux.

Requirements

Linux users must install xclip.

Ubuntu

sudo apt install xclip

CentOS

sudo yum install epel-release.noarch
sudo yum install xclip

Notice

If you want to use in the Remote Mode, please set remote.extensionKind like this:

"remote.extensionKind": {
  "hancel.markdown-image": [
    "ui"
  ]
}

And if you want to save image in your remote workplace, you must use SFTP upload method. Local couldn't use in Remote Mode.

Extension Settings

Base Settings

  • markdown-image.base.uploadMethod: Method to upload pictures. To the local or another picture CDN service.
  • markdown-image.base.fileNameFormat: The filename format for upload. Not Support in Imgur and SM.MS. You can use some variables. You can find more in setting.
  • markdown-image.base.codeType: The type of image code, you can set to <img> tag or markdown
  • markdown-image.base.imageWidth: The maximum width of the image, if the image is greater than this width, the width is set to this value. Set to 0 means not change.
  • markdown-image.base.urlEncode: Whether URL encode for the url of image.

Local Settings

  • markdown-image.local.path: Picture storage directory that in the local (automatically created if it does not exist).
  • markdown-image.local.referencePath: The reference path format in markdown(not include file name). Empty means use relative path. You can use variable of #markdown-image.base.fileNameFormat# in here. For example: /images/${YY}-${MM}/

Coding Settings

  • markdown-image.coding.token: Coding person access token.
  • markdown-image.coding.repository: Coding repository, for example: https://coding-demo.coding.net/p/coding-demo/d/coding-demo/git
  • markdown-image.coding.path: Picture upload directory that in the repository (automatically created if it does not exist).

GitHub Settings

  • markdown-image.github.path: Picture upload directory that in the repository (automatically created if it does not exist). The repository must initialization first.
  • markdown-image.github.token: GitHub person access token.
  • markdown-image.github.repository: GitHub repository, for example: https://github.com/username/repository
  • markdown-image.github.branch: GitHub repository branch to save.
  • markdown-image.github.cdn: The github cdn address format to be used, ${username} is the username of markdown-image.github.repository, and ${repository} is the repository name. ${branch} is the value of markdown-image.github.branch. ${filepath} is the upload path in repository.
  • markdown-image.github.httpProxy: Connect to Github via http proxy.

Imgur Settings

  • markdown-image.imgur.clientId: The client id registered with imgur. You can registed it at here.
  • markdown-image.imgur.httpProxy: Connect to Imgur via http proxy.

SM.MS Settings

  • markdown-image.sm_ms.token: SM.MS API token (Options). You can register an account and then visit API Token Page to generate secret token.

Qiniu Settings

  • markdown-image.qiniu.accessKey: The Access Key of account.
  • markdown-image.qiniu.secretKey: The Secret Key of account.
  • markdown-image.qiniu.bucket: The storage name.
  • markdown-image.qiniu.domain: Bound domain name of storage.
  • markdown-image.qiniu.zone: Zone of storage.

Upyun Settings

  • markdown-image.upyun.bucket: Storge name of upload.
  • markdown-image.upyun.domain: Domain bind with storge name.
  • markdown-image.upyun.operator: Operator of upyun.
  • markdown-image.upyun.password: Password of upyun operator.
  • markdown-image.upyun.path: The path that img store.
  • markdown-image.upyun.link: The link that connect to upyun.

Cloudinary Settings

These values can be found on your Cloudinary Dashboard

  • markdown-image.cloudinary.cloudName: Your user account name.
  • markdown-image.cloudinary.apiKey: API key for your account.
  • markdown-image.cloudinary.apiSecret: API secret for your account.
  • markdown-image.cloudinary.folder: Folder to upload the image to.

Cloudflare Settings

These values can be found on your Cloudflare dashboard

  • markdown-image.cloudflare.accountId: Your account ID.
  • markdown-image.cloudflare.apiToken: Cloudflare Images API token.

S3 Settings

These values can be found in your S3 service provider dashboard

  • markdown-image.s3.endpoint: The endpoint for S3 API, can be obtained from bucket setting.
  • markdown-image.s3.region: The region for the S3 bucket, can be obtained from bucket setting.
  • markdown-image.s3.bucketName: The name of the S3 bucket to upload images to. Access to the bucket should be public.
  • markdown-image.s3.accessKeyId: Your S3 API access key ID.
  • markdown-image.s3.secretAccessKey: Your S3 secret access key.

SFTP Settings

  • markdown-image.sftp.host: The host of the remote server.
  • markdown-image.sftp.port: The ssh port of the remote server.
  • markdown-image.sftp.username: The username of the remote server.
  • markdown-image.sftp.password: The password of the remote server.
  • markdown-image.sftp.privateKeyPath: The private key path of the remote server.
  • markdown-image.sftp.path: Picture storage directory that in the remote (automatically created if it does not exist). Notice: You can't use variable in here. You can use variable in #markdown-image.base.fileNameFormat#.
  • markdown-image.sftp.referencePath: The reference path format in markdown(not include file name). Empty means use relative path. You can use variable of #markdown-image.base.fileNameFormat# in here. For example: /images/${YY}-${MM}/

DIY Settings

  • markdown-image.DIY.path: The Code Path what you write. Your code must exports a function as async function (filePath:string, savePath:string, markdownPath:string):string. For example:
    const path = require("path");
    module.exports = async function (filePath, savePath, markdownPath) {
      // Return a picture access link
      return path.relative(path.dirname(markdownPath), filePath);
    };

Release Notes

1.1.35

  • Fixed the issue where only the first occurrence of the same variable for fileNameFormat was effective.

1.1.34

  • Added a new setting item markdown-image.base.altFormat to set the placeholder for image code.

1.1.33

  • Added a new setting item markdown-image.base.uploadMethods to support concurrent uploads with multiple upload methods.
  • Added a new setting item markdown-image.base.fileFormat to set the file format for saving clipboard images.
  • Removed the deprecated Coding image hosting service.
  • Supported pasting images into unconventional editing windows.

1.1.30

  • Added new setting markdown-image.github.httpProxy to settting GitHub http proxy.

1.1.29

  • Fix failed to get image from clipboard on deepin.

1.1.28

  • Support group setting.
  • Add support for remote mode.
  • Add SFTP upload method.
  • Includes the following new settings:
    • markdown-image.sftp.host
    • markdown-image.sftp.port
    • markdown-image.sftp.username
    • markdown-image.sftp.password
    • markdown-image.sftp.privateKeyPath
    • markdown-image.sftp.path
    • markdown-image.sftp.referencePath

1.1.27

  • Add support for S3 compatible providers.
  • Includes the following new settings:
    • markdown-image.s3.endpoint
    • markdown-image.s3.region
    • markdown-image.s3.bucketName
    • markdown-image.s3.accessKeyId
    • markdown-image.s3.secretAccessKey

1.1.26

  • Add support for Upyun.
  • Includes the following new settings:
    • markdown-image.upyun.bucket
    • markdown-image.upyun.domain
    • markdown-image.upyun.operator
    • markdown-image.upyun.password
    • markdown-image.upyun.path
    • markdown-image.upyun.link

1.1.25

  • Fixed image url of GitHub CDN encode wrong when enable markdown-image.base.urlEncode .

1.1.24

  • Fixed some bug of the option markdown-image.local.referencePath.
  • Fixed the alt count of image restart when restarted extension.

1.1.23

  • Added new setting markdown-image.github.cdn to settting GitHub CDN Format Address.

1.1.22

  • Fix upload wrong path in GitHub Mode.

1.1.21

  • Fix the problem of uploading to GitHub when the file path contains Chinese.

1.1.20

  • Fixed bug of the setting start with / on local.referencePath.

1.1.19

  • Fixed local mode always save to disk root path.

1.1.18

  • Fixed local mode can't use absolute path.

1.1.17

  • Add support for Cloudflare Images.
  • Includes the following new settings:
    • markdown-image.cloudflare.accountId
    • markdown-image.cloudflare.apiToken

1.1.16

  • Add to support upload image to github repository.

1.1.15

  • Add file format variable prompt. Makes it possible to enter a custom name through an input prompt when pasting the image.

1.1.14

  • Update Coding Picbed Package to fixed upload to coding error.

1.1.13

  • Added new setting markdown-image.local.referencePath to support DIY reference path in markdown file.

1.1.12

  • Added to support paste image in Jupyter file.

1.1.11

  • Updated Cloudinary CDN to use the markdown-image.base.fileNameFormat setting. The extension will check for existing files and will prompt to overwrite if necessary.

1.1.10

  • Added support for Cloudinary CDN
  • Includes the following new settings:
    • markdown-image.cloudinary.cloudName
    • markdown-image.cloudinary.apiKey
    • markdown-image.cloudinary.apiSecret
    • markdown-image.cloudinary.folder

1.1.9

  • Added setting options markdown-image.base.codeType and markdown-image.base.imageWidth use to set the maximum image width.

1.1.8

  • Fixed vscode caches the DIY path code, causing a question that cannot be changed immediately.

1.1.7

  • Added a option to switch whether url encode.

1.1.6

  • Fixed extension log level.
  • Update action after replace file.

1.1.5

  • Fixed Data URL Setting Description.

1.1.4

  • Added upload method Data URL.
  • Fixed paste multiple documents invalid.

1.1.3

  • Fixed the filename format variable ${path} were uploaded to the Coding failure in the Windows.

1.1.2

  • Fixed the path contains Chinese prompts cannot be found when pasting the copied picture again. 😂

1.1.1

  • Fixed the path contains Chinese prompts cannot be found when pasting the copied picture.

1.1.0

  • Added Beta feature, support paste rich text. (Only supports Windows)

1.0.14

  • Fixed incompatibility with Windows 7.

1.0.13

  • Fixed getting the path resolution error of the clipboard picture in Windows.

1.0.12

  • Added file name variable ${path}: "The path of the Markdown file being edited relative to the root directory."

1.0.11

  • Fix api url of sm.ms.
  • Fixed the file name with spaces cannot be found in Linux.
  • Added prompt without token in sm.ms.

1.0.10

  • Fix the variable $mdname does not remove the extension name of md.

1.0.9

  • Fixed the problem of getting wrong date and hour in filename formatting.

1.0.8

  • Add mdx support.

1.0.7

  • Fixed launch extension home page failed at MacOS and Linux.
  • Fixed the colon of the picture address is incorrectly encode.

1.0.6

  • Fixed the date variable has not consider the time zone.

1.0.5

  • Fixed file name include space could not preview.
  • Fixed random variable not work.

1.0.4

  • Update sponsored links.

1.0.3

  • Add sponsored links.

1.0.2

  • Fixed replace notice bug.

1.0.1

  • Update Readme.

1.0.0

  • Initial release.

Others

Enjoy!

More Repositories

1

vsc-google-translate

A Translate Extension for VSCode
JavaScript
96
star
2

puzzle_node

网页解谜开发模板,可以通过此模板快速开发属于自己的网页解谜游戏。
JavaScript
54
star
3

crx_wx_code_highlight

微信公众号平台代码高亮插件
JavaScript
51
star
4

ngx_proxy_wiki

Wikipedia Reverse Proxy
50
star
5

vsc-serialport-helper

VSCode Serial Port Extension. You can connect any serial port used to read / write data.
JavaScript
31
star
6

invitation-card-maker

❤ 婚礼邀请函制作工具
JavaScript
27
star
7

code-snippet

Code Snippet Share Web Site
Vue
26
star
8

pwl-chat

新版已重构,见下方链接
Vue
24
star
9

translate-platforms

Translation API from multiple platforms.
JavaScript
22
star
10

KeyGenius

⌨️ 用来定时按下某个按键。比如 Ctrl + S,免得忘记保存。
C++
19
star
11

chinese_holiday_spider_module

🐛 国家节假日解析爬虫
Python
18
star
12

eng

自考英语二单词查询网站
JavaScript
17
star
13

translate-platform-api

基于 translate-platforms 多平台翻译库 API 示例
HTML
16
star
14

librejo

📚 图书管理网站,用于个人图书管理,支持多用户。
JavaScript
15
star
15

crx_storage_editor

Editor for Local Storage and Session Storage.
Vue
14
star
16

zfxk2

正方教务管理系统抢课工具(网站改版,已失效)
C#
14
star
17

fishpi-desktop

摸鱼派新版客户端
Vue
13
star
18

github-picbed

A picture bed based on GitHub.
JavaScript
11
star
19

sticky_notes

📌 A Sticky Note App
C++
8
star
20

vsc-pwl-chat

摸鱼派聊天室
Vue
8
star
21

translator-promise

A node module to translate.
JavaScript
7
star
22

pwl-api-doc

摸鱼派 API 文档
7
star
23

fishpi-dart

Fishpi Dart API Package and CLI
Dart
5
star
24

fishpi-api-package

摸鱼派 API Package
TypeScript
4
star
25

script-restore-translate

可选恢复部分被浏览器错误翻译的文本块
JavaScript
4
star
26

coding-api-doc

Coding 企业版开放平台 API 文档
4
star
27

coding-picbed-api

Coding 图床 API (实验性项目,不建议用于正式项目)
HTML
3
star
28

lagou_address

关键字检索拉勾网公司地址及抓取职位信息脚本(已失效,官方已提供該功能)
JavaScript
3
star
29

fishpi-py

FishPi API Python Package
Python
3
star
30

fishpi-robot

模块化摸鱼派机器人框架
TypeScript
3
star
31

vue-parcel-template

基于 Parcel 打包前端,包含 iView 框架。无缝衔接 Node Express 后端框架的前后端一体代码模板。
JavaScript
2
star
32

crx_wx_mp_spider

微信公众号文章爬取
JavaScript
2
star
33

coding-picbed

基于 Coding 企业版仓库的图床。
JavaScript
2
star
34

imlinhanchao

My Blog
JavaScript
2
star
35

ImmTest

C++
2
star
36

fishpi-theme-white

摸鱼派客户端白色主题
CSS
2
star
37

maze

迷宫闯关静态Demo
JavaScript
2
star
38

fishpi-ext-xiaoice

小冰游戏摸鱼派客户端扩展
Less
1
star
39

node-addon-windows-ini

node c++ expansion of Windows ini
C++
1
star
40

whether-image

A module used to determine whether a file is a picture.
TypeScript
1
star
41

countdown-timer

一个多路倒计时器,可以用来给多个事件倒计时。
JavaScript
1
star
42

lanqiao

蓝桥杯试题集自动抓取Chrome扩展
JavaScript
1
star
43

christmas

圣诞头像制作
JavaScript
1
star
44

triangle

JavaScript
1
star
45

demo-page

1
star
46

fishpi-ext-tail

Less
1
star
47

fishpi-ext-off-work

摸鱼派客户端下班倒计时扩展
Less
1
star
48

fishpi-theme-mini

摸鱼派客户端 Mini 主题
CSS
1
star
49

fishpi-ext-thinking-wall

摸鱼派思过崖
Less
1
star
50

watermark-tool

一个照片添加水印的网页工具
HTML
1
star
51

balloon

气泡提示控件
JavaScript
1
star
52

vue3-nestjs-template

Vue3 + NestJs Web App Template
TypeScript
1
star
53

bit

位计算器演示网页
HTML
1
star