Gist: How are images uploaded to a gist?

前端 未结 8 2026
夕颜
夕颜 2020-12-22 15:33

Here is the image file: https://gist.github.com/mbostock/5503544#file-thumbnail-png

I tried to drag-and-drop the image file in the edit mode of a gist. That didn\'t

相关标签:
8条回答
  • 2020-12-22 16:13

    With a little creativity you can achieve this faster than cloning. To drag/drop:

    1. Create the Gist
    2. Drag an image into the comment field below. This will auto-upload your image file to https://user-images.githubusercontent.com and insert markdown code in the comment field to display the image.
    3. Copy this markdown code to your gist

    Note: It is not required that you submit the comment.

    Live example

    0 讨论(0)
  • 2020-12-22 16:13

    I was looking for answer for the same question, here is what I just found:

    1. You can clone your gist as a git repository and add your picture, then push to origin. See loading-thumbnail-into-gist-for.

    2. There is a script written to do this: hecticjeff/gist-img.

    I have not tried the above solutions yet, but pretty sure they should work. I did try using defunkt/gist to update my gist with a png but ended up displaying a binary file in my gist.

    0 讨论(0)
  • 2020-12-22 16:16

    I was looking for an answer to this same question too, in my case in order to be able to upload PDF files. I had trouble with gist-img (mentioned in another answer to this question). I searched some more and discovered gistup, which worked perfectly, the first time I tried it. It uses node and npm, so it should work on most major operating systems.

    0 讨论(0)
  • 2020-12-22 16:18

    How to put images in your Gist url:

    1. upload your image to a place like imgur.com for free, then get the hot-link.
    2. Add a file and give it a markdown extension .md and use markdown image syntax:

    ![alt text here](https://URL)

    1. ?????
    2. Profit
    0 讨论(0)
  • 2020-12-22 16:27

    Clone gist with SSH:

    $ git clone git@gist.github.com:<hash>.git mygist
    

    HTTP clone worked fine, but ran into HTTP authentication problems at git push.

    0 讨论(0)
  • 2020-12-22 16:30

    If you upload an image, try these steps:

    • Convert your image into DataURI. For example here on duri.me
    • Then this string insert to GIST as a text file

    If you want to convert back, there are several options. For example, this: Converting data URI to image data

    0 讨论(0)
提交回复
热议问题