我想使用Markdown存储文本信息。但快速搜索显示Markdown不支持颜色。堆栈溢出也不支持颜色。与GitHub markdown的情况相同。
是否有允许彩色文本的markdown风格?
我想使用Markdown存储文本信息。但快速搜索显示Markdown不支持颜色。堆栈溢出也不支持颜色。与GitHub markdown的情况相同。
是否有允许彩色文本的markdown风格?
当前回答
这应该更短:
<font color='red'>test blue color font</font>
其他回答
我已经成功了
<span class="someclass"></span>
注意:该类必须已经存在于网站上。
我喜欢重新定义现有标记的想法,如果它们未被使用,因为文本更干净,而牺牲了现有标记。内联样式有效,但在读取原始文本时会产生大量噪音。
使用VSCode,我发现顶部有一个小的<style>部分支持的自定义单字母标签在最小噪声的情况下工作得很好,特别是对于专色,例如。
<style>
r { color: Red }
o { color: Orange }
g { color: Green }
</style>
# TODOs:
- <r>TODO:</r> Important thing to do
- <o>TODO:</o> Less important thing to do
- <g>DONE:</g> Breath deeply and improve karma
我的用例是在开发过程中组织应用程序内的笔记,但我想它可能在其他地方奏效?
这应该更短:
<font color='red'>test blue color font</font>
将此命令放入RMarkdown标头
header-includes: \usepackage{xcolor}
然后使用此命令为文本上色
\textcolor{green}{Text is green!}
虽然Markdown不支持颜色,但如果你不需要太多,你总是可以牺牲一些支持的样式,使用CSS重新定义相关的标记,使其变为颜色,并删除格式,或者不删除。
例子:
// resets
s { text-decoration:none; } //strike-through
em { font-style: normal; font-weight: bold; } //italic emphasis
// colors
s { color: green }
em { color: blue }
另请参阅:如何将em标记重新设置为粗体而不是斜体
然后在标记文本中
~~This is green~~
_this is blue_