【问题标题】:Why doesn't Sphinx translate :kbd: roles to HTML's <kbd> tags?为什么 Sphinx 不将 :kbd: 角色转换为 HTML 的 <kbd> 标签?
【发布时间】:2017-04-02 21:07:57
【问题描述】:

我想将键盘键和输入标记为键“图标”。 Sphinx 提供了:kbd: 角色来标记单个字符或单词,但生成的 HTML 包含&lt;code class="kbd ......"&gt; 标签。

那么为什么 Sphinx 不将 :kbd: 角色翻译成 HTML 的标签呢?

(我使用的是阅读文档主题。)


我发现一些 CSS 可以将&lt;kbd&gt;-tags 转换成漂亮的键。

kbd
{
  -moz-border-radius:3px;
  -moz-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
  -webkit-border-radius:3px;
  -webkit-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
  background-color:#f7f7f7;
  border:1px solid #ccc;
  border-radius:3px;
  box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;
  color:#333;
  display:inline-block;
  font-family:Arial,Helvetica,sans-serif;
  font-size:11px;
  line-height:1.4;
  margin:0 .1em;
  padding:.1em .6em;
  text-shadow:0 1px 0 #fff;
}

来源:http://meta.superuser.com/questions/4788/css-for-the-new-kbd-style

【问题讨论】:

标签: html css python-sphinx restructuredtext read-the-docs


【解决方案1】:

relevant issue 现已关闭,Sphinx 确实使用了kbd 标签。

【讨论】:

    猜你喜欢
    • 2019-08-23
    • 1970-01-01
    • 2015-11-23
    • 1970-01-01
    • 2016-12-26
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多