github README.md中心图像 [英] github README.md center image

查看:111
本文介绍了github README.md中心图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在研究GitHub中使用的markdown语法一段时间,但除了调整readme.md页面的大小以外,我无法弄清楚如何将图像居中。



可能吗?如果是这样,怎么样?

解决方案


我一直在寻找github中使用的markdown语法[...],我无法弄清楚如何放置图片中心


TL; DR

不,您只能依靠 依靠Markdown语法。 Markdown不关心定位。



注意:有些降价处理器支持包含HTML(如@ waldyr.ar正确指出的那样) ,而在GitHub的情况下,您可能会后退到类似于< div style =text-align:center>< img src =.../>< / div> 。请注意,如果您的存储库在不同的托管环境中分支(Codeplex,BitBucket,...),或者文档未通过浏览器读取(Sublime Text Markdown预览,MarkdownPad,VisualStudio Web注意2:请注意,即使在GitHub网站中,呈现markdown的方式也是如此。不统一。举例来说,wiki不会允许这样的CSS位置欺骗。



未删节版本



Markdown语法 没有提供控制位置的功能。 b
$ b

事实上,如果允许这样的格式化,它将与Markdown理念接壤,正如 哲学 部分


A

Markdown文件由github.com网站通过使用Ruby Redcarpet 库进行呈现。



Redcarpet暴露了一些 扩展 (例如删除线等)这些不是标准Markdown语法的一部分,并提供了额外的功能。但是,没有受支持的扩展程序可让您将图片居中。


I've been looking at the markdown syntax used in GitHub for a while but except resizing an image to the extent of the readme.md page, I can't figure out how to center an image in it.

Is it possible? If it is, how?

解决方案

I've been looking at the markdown syntax used in github [...], I can't figure out how to center an image

TL;DR

No you can't by only relying on Markdown syntax. Markdown doesn't care with positioning.

Note: Some markdown processors support inclusion of HTML (as rightfully pointed out by @waldyr.ar), and in the GitHub case you may fallback to something like <div style="text-align:center"><img src ="..." /></div>. Beware that there's no guarantee the image will be centered if your repository is forked in a different hosting environment (Codeplex, BitBucket, ...) or if the document isn't read through a browser (Sublime Text Markdown preview, MarkdownPad, VisualStudio Web Essentials Markdown preview, ...).

Note 2: Keep in mind that even within the GitHub website, the way markdown is rendered is not uniform. The wiki, for instance, won't allow such css positional trickery.

Unabridged version

The Markdown syntax doesn't provide one with the ability to control the position of an image.

In fact, it would be borderline against the Markdown philosophy to allow such formatting, as stated in the "Philosophy" section

"A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. "

Markdown files are rendered by github.com website through the use of the Ruby Redcarpet library.

Redcarpet exposes some extensions (such as strikethrough, for instance) which are not part of standard Markdown syntax and provide additional "features". However, no supported extension allow you to center an image.

这篇关于github README.md中心图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆