如何使用ReStructured Text(rst2html.py)在文本中使用颜色或如何插入不带空行的HTML标记? [英] How to use color in text with ReStructured Text (rst2html.py) or how to insert HTML tags without blank lines?

查看:486
本文介绍了如何使用ReStructured Text(rst2html.py)在文本中使用颜色或如何插入不带空行的HTML标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用重构结构文本的颜色?例如, ** hello ** 转换为< strong> hello< / strong> 。如何使ReStructure(rst2html.py)将东西翻译为< font color =####>文字< / font>

我想到了.raw :: html,但它引入了空白行。我想插入不带空行的HTML标签。

解决方案

我发现这个方法可行


$ b

  ..角色::红色

它的翻译如下:

 < p>使用< span class =red>解读文字< / span>< / p>的例子

现在,您有红色课程,您可以使用CSS更改颜色。

  .red {
颜色:红色;
}


How can I use color with ReStructured Text? For example, **hello** translates into <strong>hello</strong>. How can I make ReStructure(rst2html.py) translate something into <font color="####">text</font>?

I thought about ..raw:: html, but it introduces blank lines. I want to insert HTML tags without blank lines.

解决方案

I found this method working

First, you have the role.

.. role:: red

An example of using :red:`interpreted text`

It translates into as follows.

<p>An example of using <span class="red">interpreted text</span></p>

Now, you have the red class, you can use CSS for changing colors.

.red {
    color:red;
}

这篇关于如何使用ReStructured Text(rst2html.py)在文本中使用颜色或如何插入不带空行的HTML标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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