Resize image in the wiki of GitHub using Markdown

2019-01-29 18:04发布

I'm writing a wiki page on GitHub, and I'm using Markdown.

My problem is that I'm putting a large image (this image is in its own repository) and I need resize it.

I have tried different solutions, but they do not work:

![image](http://url.to/image.png "Title" {width=40px height=400px})

![image](http://url.to/image.png = 250x250)

![image](http://url.to/image.png = 250x)

[[http://url.to/image.png = 250x]]

Is there a way to get it?

It is preferable without HTML.

4条回答
Evening l夕情丶
2楼-- · 2019-01-29 18:34

On GitHub, you can use HTML directly instead of Markdown:

<a href="url"><img src="http://url.to/image.png" align="left" height="48" width="48" ></a>

This should make it.

查看更多
仙女界的扛把子
3楼-- · 2019-01-29 18:34

In December 2015, it seems that only links to files on github.com or cloud.githubusercontent.com or the like work. Steps that worked for me in a gist:

  1. Make a gist, say Mygist.md (and optionally more files)
  2. Go to the "Write Comment" box at the end
  3. Click "Attach files ... by selecting them"; select your local image file
  4. GitHub echos a long long string where it put the image, e.g. ![khan-lasso-squared](https://cloud.githubusercontent.com/assets/1280390/12011119/596fdca4-acc2-11e5-84d0-4878164e04bb.png)
  5. Cut-paste that by hand into your Mygist.md.

But: GitHub people may change this behavior tomorrow, without documenting it.

查看更多
老娘就宠你
4楼-- · 2019-01-29 18:39

GitHub Pages now uses kramdown as its markdown engine so you can use the following syntax:

Here is an inline ![smiley](smiley.png){:height="36px" width="36px"}.

http://kramdown.gettalong.org/syntax.html#images

I haven't tested it on GitHub wiki though.

查看更多
仙女界的扛把子
5楼-- · 2019-01-29 18:57

Updated:

Code (external/internal):

![test](https://github.com/favicon.ico)

Code (internal/external for sizing):

<img src="https://github.com/favicon.ico" width="48">

Example:

test


Old Answer:

This should work:

[[ http://url.to/image.png | height = 100px ]]

Source: https://guides.github.com/features/mastering-markdown/

查看更多
登录 后发表回答