问题描述
我的项目有一个 README.md
文件
但屏幕截图不是文本,防止读者复制/粘贴屏幕截图中的命令.它们的创建/编辑/维护也很麻烦,并且浏览器加载速度较慢.现代网络使用文本样式,而不是一堆渲染的文本图像.
虽然一些 Markdown 解析器支持内联 HTML 样式,但 GitHub 不支持;这不起作用:
一些绿色文本 </span>
这不起作用:
一些绿色文本 </font>
向 README 添加颜色的一种方法是利用提供 占位符图像.
例如可以使用这个 Markdown:
-  `#f03c15`-  `#c5f015`-  `#1589F0`
要创建您喜欢的任何颜色的列表:
-
#f03c15
-
#c5f015
-
#1589F0
I have a README.md
file for my project underscore-cli, and I want to document the --color
flag.
Currently, the only way to do this is with a screenshot (which can be stored in the project repository):
But screenshots aren't text, preventing readers from copy/pasting the command in the screenshot. They're also a pain to create / edit / maintain, and are slower for browsers to load. The modern web uses text styles, not a bunch of rendered images of text.
While some Markdown parsers support inline HTML styling, GitHub doesn't; this doesn't work:
<span style="color: green"> Some green text </span>
This doesn't work:
<font color="green"> Some green text </font>
One way to add color to a README is by utilising a service that provides placeholder images.
For example this Markdown can be used:
-  `#f03c15`
-  `#c5f015`
-  `#1589F0`
To create a list of any colors you like:
-
#f03c15
-
#c5f015
-
#1589F0
这篇关于如何为 GitHub 的 README.md 文件添加颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!