English Readme / 简体中文说明 / 繁體中文說明
An extension for conveniently inserting pictures in Markdown, which supports storing pictures in local or third-party CDN service.
❤ Sponsor me / 赞助开发者
Ctrl + Shift + V
, or right-click menu Paste Image
.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.Linux users must install xclip.
Ubuntu
sudo apt install xclip
CentOS
sudo yum install epel-release.noarch
sudo yum install xclip
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.local.path
: Picture storage directory that in the local (automatically created if it does not exist).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).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.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.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.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.These values can be found on your Cloudflare dashboard
markdown-image.cloudflare.accountId
: Your account ID.markdown-image.cloudflare.apiToken
: Cloudflare Images API token.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);
}
/
on local.referencePath
.markdown-image.cloudflare.accountId
markdown-image.cloudflare.apiToken
prompt
. Makes it possible to enter a custom name through an input prompt when pasting the image.markdown-image.local.referencePath
to support DIY reference path in markdown file.markdown-image.base.fileNameFormat
setting. The extension will check for existing files and will prompt to overwrite if necessary.markdown-image.cloudinary.cloudName
markdown-image.cloudinary.apiKey
markdown-image.cloudinary.apiSecret
markdown-image.cloudinary.folder
markdown-image.base.codeType
and markdown-image.base.imageWidth
use to set the maximum image width.DIY
path code, causing a question that cannot be changed immediately.Data URL
Setting Description.Data URL
.${path}
were uploaded to the Coding
failure in the Windows.${path}
: "The path of the Markdown file being edited relative to the root directory."sm.ms
.sm.ms
.
$mdname
does not remove the extension name of md
.Enjoy!