Skip to content
extract image from markdown, upload, replace path
TypeScript JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
images feat(docs): rewrite usage for v2.0.0 Aug 25, 2019
src
types
.eslintignore
.eslintrc.json
.gitattributes
.gitignore
.markdownlint.json
.vscodeignore
CHANGELOG.md
License.md
README.md
link.md
package-lock.json
package.json 2.1.3 Sep 24, 2019
tsconfig.json
webpack.config.js

README.md

google-photos-uploader

Version Installs

icon

This extension just provides google-photos-uploader: Upload image and replace command.

The command will do all the step shown below:

  1. extract img path from your markdown text
  2. upload to Google Photos
  3. replace img path to Google Photos published url

Keep in mind that this plugin will publish all images the target markdown file referencing to all over the world.

select_upload

How to use

Run command

Open command palet(Ctrl+Shift+P), find google-photos-uploader: Upload image and replace command and execute.

run command

(OAuth)

This plugin sometimes request you OAuth2 Authentication.

In this case, default browser will be started.

  1. Select Google acount and login
    oauth2_select_account
  2. App verification is now in progress. Until I receive Google's response, please ignore this warning to continue when you think this plugin is reliable.
    unverifiied_apps_notification
  3. Authorize these parmissions.
    oauth2_scope_check_1
    oauth2_scope_check_1
  4. Authorize these parmissions again!(I don't know why authorize phase are duplicated)
    oauth2_scope_check_3
  5. Sucess! Go back to vscode.
    oauth2_success

Select Album

Because of Google Photos API limitation, albums you can add photos must be created by this plugin.

So, you have 3 choices to upload images.

  1. I don't want to add photos to albums: not tested
  2. create a new album
  3. select album already created by this plugin

select album

When you chose create a new album, you need to specify the new album name.

create album

Please wait for seconds

On this phase, this plugin executes below:

  1. extract image path
  2. upload image (depend on the total image size and your traffic speed, showing progress info)
  3. register images to the album
  4. get published image URL
  5. replace image path to the URL

uploading

select_upload

finish

Known Issue

Because of pulldown-cmark-to-cmark limitation, all code block will be replaced like below:

before:

```typescript
console.log("arikitari na sekai");
```

after:

````typescript
console.log("arikitari na sekai");
````

Almost all cases, that is no problem because HTML converted result will be equal.

However, in some cases, the replaced result will be broken.

before:

`````markdown
````markdown
```typescript
console.log("arikitari na sekai");
```
````
`````

after:

````markdown
````markdown
```typescript
console.log("arikitari na sekai");
```
````
````
You can’t perform that action at this time.