Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

preface

In study and work, Hei often needs to write, whether it is taking notes, or writing a blog, or writing interface documents or technical documents in work.

In this process, I used many tools. At the beginning, I used Word, but it took a lot of time to adjust the format and typesetting.

I have also used some note-taking software, such as Impression, Youdao and Wezhi, etc. However, there is a problem with all of them. If there are pictures in my notes, I need to upload the pictures separately and replace them in the blog content when I want to post the notes to other blog platforms, which is quite time-consuming and energy consuming.

Finally, I found a perfect matching scheme, which was to use Typora to record, and then build a graph bed. When the picture was inserted into Typora, it was automatically uploaded to the graph bed, so that there was no need to replace the picture one by one when it was released on other platforms.

Typora

Typora is a simple Markdown editor and reader, which can help us to use Markdown for typesetting more quickly and conveniently. We do not need to learn Markdown grammar, which can greatly improve our efficiency and focus on writing itself. Typora installation package can be downloaded directly from the official website.

Typora website: www.typora.io/

Typora is an excellent Markdown editor, but it doesn’t solve my pain point about uploading pictures.

At the beginning, I wrote notes in Typora, pasted pictures and saved them in the same directory as the notes, but once I moved the MD file of the notes, the pictures could not be displayed.

At one point, I did this by creating a folder for each note and storing both notes and images.

And it doesn’t solve the problem of re-uploading images when I publish to other platforms.

Is there a solution to this problem? Is there any way that when I insert an image into Typora, I can automatically upload the image to the web and use the URL of the image in my notes?

PicGo+Gitee picture automatic upload

PicGo is a graph bed tool, the so-called graph bed tool, is automatically convert the local picture into a link of a tool, there are many graph bed tools on the network, in terms of the current type of use, PicGo is a better graph bed tool. The default support sm. MS picture bed, Tencent cloud, GitHub, Seven cow, Ali cloud OSS upload pictures, I use Gitee for two reasons, one is GitHub access speed is relatively slow, the other is that other storage services need to spend money.

Now let’s complete the setup step by step.

Download and install PicGo

Download: github.com/Molunerfinn…

GitHub download speed is slow, you can use Baidu cloud connection to download.

Link: pan.baidu.com/s/1iq9GgMrh…

Extraction code: N95D

After downloading and installing, the interface will look like this.

At this time we have a map bed tools, the next to prepare to store pictures of the network environment.

Register to configure Gitee

Those who are already registered with Gitee can use it directly, but those who are not can just sign up.

The first step is to build a new warehouse dedicated to storing pictures.

Click the “+” in the upper right corner to create the warehouse.

Give your image repository a name and initialize it.

Make sure to select “open source” so that other platforms can access your images, check the initialization repository, and select “single branch” as the branch model. This will create the Master branch by default.

Generate a Gitee private token

The main function of the token is for PicGo to verify when doing upload, not everyone can upload things to your warehouse, right?

Click “Private Token” in security Settings on the left and click “Generate new token”.

You just need to select the Projects permission.

After submission, you will be asked to verify the password, and a token generation prompt will pop up after successful verification.

Be sure to copy the token and save it for later configuration of PicGo, and there will be no place to display it after this page is closed.

PicGo installs the Gitee plug-in

The newly installed PicGo did not include Gitee beds in its chart beds setup, which required clicking on the “Install” plug-in (Poor) and sure was simple.

Select “Plug-in Settings” to search for Gitee, and select the first “Gitee 2.0.4” to install it. After the installation is complete, you need to restart.

PicGo with Gitee map bed

The PicGo configuration corresponds to Gitee information as shown in the following figure.

PicGo set

In order to make it easy to open the image, if you have requirements on the image name, you can open the rename before uploading, the default will use the timestamp as the file name.

From here, you can test your image by uploading it in the upload area to see if it is successfully uploaded to the Gitee repository.

Typora configures the image upload service

In our last step, all the previous configuration is for the purpose that we can upload images directly to the network in Typora.

Open the “file “->” preferences” of Typora, click the check box as shown in the picture below, select upload picture when inserting picture, upload service select PicGo, select the path of local installation of PicGo. When finished, restart Typora.

Operating a

Finally, to verify, copy the image and paste it in Typora, the image will be successfully uploaded to Gitee warehouse.

Done, spread flowers ~