summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakayuki Shimizukawa <shimizukawa+bitbucket@gmail.com>2014-08-20 06:45:18 +0900
committerTakayuki Shimizukawa <shimizukawa+bitbucket@gmail.com>2014-08-20 06:45:18 +0900
commit0f0a65c7d2df7d6e8dd8971c63a1b79d4086fc1d (patch)
treea5a80cf80edf9e490f1ef87faadaa712763ef574
parent099824c8981eef7596e281e1fddf706de06cc191 (diff)
parent775cb2ce0daf0b0ae9e69b78ad7d6426612fb7ec (diff)
downloadsphinx-0f0a65c7d2df7d6e8dd8971c63a1b79d4086fc1d.tar.gz
Merged in tk0miya/sphinx (pull request #269)
Fix #1476 replace <tt> tag by <code>
-rw-r--r--sphinx/themes/basic/domainindex.html2
-rw-r--r--sphinx/themes/basic/static/basic.css_t10
-rw-r--r--sphinx/themes/basic/static/websupport.js4
-rw-r--r--sphinx/themes/default/static/default.css_t6
-rw-r--r--sphinx/themes/epub/static/epub.css12
-rw-r--r--sphinx/themes/haiku/static/haiku.css_t2
-rw-r--r--sphinx/themes/nature/static/nature.css_t2
-rw-r--r--sphinx/themes/pyramid/static/epub.css6
-rw-r--r--sphinx/themes/pyramid/static/pyramid.css_t4
-rw-r--r--sphinx/themes/scrolls/static/scrolls.css_t4
-rw-r--r--sphinx/themes/sphinxdoc/static/sphinxdoc.css_t10
-rw-r--r--sphinx/themes/traditional/static/traditional.css_t12
-rw-r--r--sphinx/writers/html.py14
-rw-r--r--tests/test_build_html.py20
-rw-r--r--tests/test_markup.py12
15 files changed, 60 insertions, 60 deletions
diff --git a/sphinx/themes/basic/domainindex.html b/sphinx/themes/basic/domainindex.html
index ac5aed9f..4ee62d55 100644
--- a/sphinx/themes/basic/domainindex.html
+++ b/sphinx/themes/basic/domainindex.html
@@ -44,7 +44,7 @@
{%- endif %}</td>
<td>{% if grouptype == 2 %}&nbsp;&nbsp;&nbsp;{% endif %}
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%}
- <tt class="xref">{{ name|e }}</tt>
+ <code class="xref">{{ name|e }}</code>
{%- if page %}</a>{% endif %}
{%- if extra %} <em>({{ extra|e }})</em>{% endif -%}
</td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %}
diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t
index d4561bfa..cb1a923c 100644
--- a/sphinx/themes/basic/static/basic.css_t
+++ b/sphinx/themes/basic/static/basic.css_t
@@ -480,7 +480,7 @@ div.code-block-filename {
font-size: small;
}
-div.code-block-filename tt {
+div.code-block-filename code {
background-color: transparent;
}
@@ -489,22 +489,22 @@ div.code-block-filename + div.highlight > pre {
margin-top: 0;
}
-tt.descname {
+code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
-tt.descclassname {
+code.descclassname {
background-color: transparent;
}
-tt.xref, a tt {
+code.xref, a code {
background-color: transparent;
font-weight: bold;
}
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
diff --git a/sphinx/themes/basic/static/websupport.js b/sphinx/themes/basic/static/websupport.js
index 71c0a136..9932afb9 100644
--- a/sphinx/themes/basic/static/websupport.js
+++ b/sphinx/themes/basic/static/websupport.js
@@ -700,8 +700,8 @@
(<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
<div class="comment-markup-box" id="mb<%id%>">\
reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
- <tt>``code``</tt>, \
- code blocks: <tt>::</tt> and an indented block after blank line</div>\
+ <code>``code``</code>, \
+ code blocks: <code>::</code> and an indented block after blank line</div>\
<form method="post" id="cf<%id%>" class="comment-form" action="">\
<textarea name="comment" cols="80"></textarea>\
<p class="propose-button">\
diff --git a/sphinx/themes/default/static/default.css_t b/sphinx/themes/default/static/default.css_t
index ae4012d0..c0fbdd8c 100644
--- a/sphinx/themes/default/static/default.css_t
+++ b/sphinx/themes/default/static/default.css_t
@@ -281,7 +281,7 @@ pre {
border-right: none;
}
-tt {
+code {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
@@ -291,11 +291,11 @@ th {
background-color: #ede;
}
-.warning tt {
+.warning code {
background: #efc2c2;
}
-.note tt {
+.note code {
background: #d6d6d6;
}
diff --git a/sphinx/themes/epub/static/epub.css b/sphinx/themes/epub/static/epub.css
index 2e90481d..a03c0627 100644
--- a/sphinx/themes/epub/static/epub.css
+++ b/sphinx/themes/epub/static/epub.css
@@ -433,26 +433,26 @@ table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
-tt {
+code {
font-family: monospace;
}
-tt.descname {
+code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
-tt.descclassname {
+code.descclassname {
background-color: transparent;
}
-tt.xref, a tt {
+code.xref, a code {
background-color: transparent;
font-weight: bold;
}
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
@@ -535,4 +535,4 @@ table .link-target {
src: url("res:///Data/fonts/LiberationNarrow-BoldItalic.otf")
format("opentype");
}
-*/ \ No newline at end of file
+*/
diff --git a/sphinx/themes/haiku/static/haiku.css_t b/sphinx/themes/haiku/static/haiku.css_t
index bd81db0a..c6cb42d8 100644
--- a/sphinx/themes/haiku/static/haiku.css_t
+++ b/sphinx/themes/haiku/static/haiku.css_t
@@ -307,7 +307,7 @@ td {
vertical-align: top;
}
-tt {
+code {
background-color: #e2e2e2;
font-size: 1.0em;
font-family: monospace;
diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t
index 7909e813..84b37517 100644
--- a/sphinx/themes/nature/static/nature.css_t
+++ b/sphinx/themes/nature/static/nature.css_t
@@ -226,7 +226,7 @@ pre {
-moz-box-shadow: 1px 1px 1px #d8d8d8;
}
-tt {
+code {
background-color: #ecf0f3;
color: #222;
/* padding: 1px 2px; */
diff --git a/sphinx/themes/pyramid/static/epub.css b/sphinx/themes/pyramid/static/epub.css
index 7465a421..60383755 100644
--- a/sphinx/themes/pyramid/static/epub.css
+++ b/sphinx/themes/pyramid/static/epub.css
@@ -281,7 +281,7 @@ pre {
border-right: none;
}
-tt {
+code {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 0.95em;
@@ -291,11 +291,11 @@ th {
background-color: #ede;
}
-.warning tt {
+.warning code {
background: #efc2c2;
}
-.note tt {
+.note code {
background: #d6d6d6;
}
diff --git a/sphinx/themes/pyramid/static/pyramid.css_t b/sphinx/themes/pyramid/static/pyramid.css_t
index 053f61fa..6ffdb714 100644
--- a/sphinx/themes/pyramid/static/pyramid.css_t
+++ b/sphinx/themes/pyramid/static/pyramid.css_t
@@ -295,7 +295,7 @@ pre {
border-left-style: none;
}
-tt {
+code {
background-color: transparent;
color: #222;
font-size: 1.1em;
@@ -336,7 +336,7 @@ a:hover em.std-term {
font-style: normal;
}
-tt.xref {
+code.xref {
font-weight: normal;
font-style: normal;
}
diff --git a/sphinx/themes/scrolls/static/scrolls.css_t b/sphinx/themes/scrolls/static/scrolls.css_t
index 65b25042..9591f045 100644
--- a/sphinx/themes/scrolls/static/scrolls.css_t
+++ b/sphinx/themes/scrolls/static/scrolls.css_t
@@ -195,7 +195,7 @@ pre {
font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;
}
-tt {
+code {
font-size: 13px;
font-family: 'Bitstream Vera Sans Mono', 'Monaco', monospace;
color: black;
@@ -204,7 +204,7 @@ tt {
border-bottom: 1px solid #eee;
}
-a.reference:hover tt {
+a.reference:hover code {
border-bottom-color: #aaa;
}
diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t
index 9f90d56f..174b5950 100644
--- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t
+++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t
@@ -204,20 +204,20 @@ a.headerlink:hover {
color: white!important;
}
-cite, code, tt {
+cite, code, code {
font-family: 'Consolas', 'Deja Vu Sans Mono',
'Bitstream Vera Sans Mono', monospace;
font-size: 0.95em;
letter-spacing: 0.01em;
}
-tt {
+code {
background-color: #f2f2f2;
border-bottom: 1px solid #ddd;
color: #333;
}
-tt.descname, tt.descclassname, tt.xref {
+code.descname, code.descclassname, code.xref {
border: 0;
}
@@ -226,12 +226,12 @@ hr {
margin: 2em;
}
-a tt {
+a code {
border: 0;
color: #CA7900;
}
-a tt:hover {
+a code:hover {
color: #2491CF;
}
diff --git a/sphinx/themes/traditional/static/traditional.css_t b/sphinx/themes/traditional/static/traditional.css_t
index 4b6e5c41..a82ef53c 100644
--- a/sphinx/themes/traditional/static/traditional.css_t
+++ b/sphinx/themes/traditional/static/traditional.css_t
@@ -318,7 +318,7 @@ div#comments div.comment h4 {
}
div#comments div.comment pre,
-div#comments div.comment tt {
+div#comments div.comment code {
background-color: #ddd;
color: #111;
border: none;
@@ -616,23 +616,23 @@ pre {
border-right: none;
}
-tt {
+code {
font-family: monospace;
background-color: #ecf0f3;
padding: 0 1px 0 1px;
}
-tt.descname {
+code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
-tt.descclassname {
+code.descclassname {
background-color: transparent;
}
-tt.xref, a tt {
+code.xref, a code {
background-color: transparent;
font-weight: bold;
}
@@ -651,7 +651,7 @@ tt.xref, a tt {
margin-left: 1.5em;
}
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py
index abd4ccaa..0874c7ce 100644
--- a/sphinx/writers/html.py
+++ b/sphinx/writers/html.py
@@ -111,9 +111,9 @@ class HTMLTranslator(BaseTranslator):
self.body.append('</dt>\n')
def visit_desc_addname(self, node):
- self.body.append(self.starttag(node, 'tt', '', CLASS='descclassname'))
+ self.body.append(self.starttag(node, 'code', '', CLASS='descclassname'))
def depart_desc_addname(self, node):
- self.body.append('</tt>')
+ self.body.append('</code>')
def visit_desc_type(self, node):
pass
@@ -126,9 +126,9 @@ class HTMLTranslator(BaseTranslator):
pass
def visit_desc_name(self, node):
- self.body.append(self.starttag(node, 'tt', '', CLASS='descname'))
+ self.body.append(self.starttag(node, 'code', '', CLASS='descname'))
def depart_desc_name(self, node):
- self.body.append('</tt>')
+ self.body.append('</code>')
def visit_desc_parameterlist(self, node):
self.body.append('<span class="sig-paren">(</span>')
@@ -284,7 +284,7 @@ class HTMLTranslator(BaseTranslator):
starttag = self.starttag(node, 'div', suffix='',
CLASS='highlight-%s' % lang)
if 'filename' in node:
- starttag += '<div class="code-block-filename"><tt>%s</tt></div>' % (
+ starttag += '<div class="code-block-filename"><code>%s</code></div>' % (
node['filename'],)
self.body.append(starttag + highlighted + '</div>\n')
raise nodes.SkipNode
@@ -300,12 +300,12 @@ class HTMLTranslator(BaseTranslator):
# overwritten
def visit_literal(self, node):
- self.body.append(self.starttag(node, 'tt', '',
+ self.body.append(self.starttag(node, 'code', '',
CLASS='docutils literal'))
self.protect_literal_text += 1
def depart_literal(self, node):
self.protect_literal_text -= 1
- self.body.append('</tt>')
+ self.body.append('</code>')
def visit_productionlist(self, node):
self.body.append(self.starttag(node, 'pre'))
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index 2c5f291e..d13c7ac6 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -122,21 +122,21 @@ HTML_XPATH = {
(".//li/strong", r'^command\\n$'),
(".//li/strong", r'^program\\n$'),
(".//li/em", r'^dfn\\n$'),
- (".//li/tt/span[@class='pre']", r'^kbd\\n$'),
+ (".//li/code/span[@class='pre']", r'^kbd\\n$'),
(".//li/em", u'File \N{TRIANGULAR BULLET} Close'),
- (".//li/tt/span[@class='pre']", '^a/$'),
- (".//li/tt/em/span[@class='pre']", '^varpart$'),
- (".//li/tt/em/span[@class='pre']", '^i$'),
+ (".//li/code/span[@class='pre']", '^a/$'),
+ (".//li/code/em/span[@class='pre']", '^varpart$'),
+ (".//li/code/em/span[@class='pre']", '^i$'),
(".//a[@href='http://www.python.org/dev/peps/pep-0008']"
"[@class='pep reference external']/strong", 'PEP 8'),
(".//a[@href='http://tools.ietf.org/html/rfc1.html']"
"[@class='rfc reference external']/strong", 'RFC 1'),
(".//a[@href='objects.html#envvar-HOME']"
- "[@class='reference internal']/tt/span[@class='pre']", 'HOME'),
+ "[@class='reference internal']/code/span[@class='pre']", 'HOME'),
(".//a[@href='#with']"
- "[@class='reference internal']/tt/span[@class='pre']", '^with$'),
+ "[@class='reference internal']/code/span[@class='pre']", '^with$'),
(".//a[@href='#grammar-token-try_stmt']"
- "[@class='reference internal']/tt/span", '^statement$'),
+ "[@class='reference internal']/code/span", '^statement$'),
(".//a[@href='subdir/includes.html']"
"[@class='reference internal']/em", 'Including in subdir'),
(".//a[@href='objects.html#cmdoption-python-c']"
@@ -165,7 +165,7 @@ HTML_XPATH = {
(".//dl/dt[@id='term-boson']", 'boson'),
# a production list
(".//pre/strong", 'try_stmt'),
- (".//pre/a[@href='#grammar-token-try1_stmt']/tt/span", 'try1_stmt'),
+ (".//pre/a[@href='#grammar-token-try1_stmt']/code/span", 'try1_stmt'),
# tests for ``only`` directive
(".//p", 'A global substitution.'),
(".//p", 'In HTML.'),
@@ -175,8 +175,8 @@ HTML_XPATH = {
'objects.html': [
(".//dt[@id='mod.Cls.meth1']", ''),
(".//dt[@id='errmod.Error']", ''),
- (".//dt/tt", r'long\(parameter,\s* list\)'),
- (".//dt/tt", 'another one'),
+ (".//dt/code", r'long\(parameter,\s* list\)'),
+ (".//dt/code", 'another one'),
(".//a[@href='#mod.Cls'][@class='reference internal']", ''),
(".//dl[@class='userdesc']", ''),
(".//dt[@id='userdesc-myobj']", ''),
diff --git a/tests/test_markup.py b/tests/test_markup.py
index e58cfe68..81ade641 100644
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -83,16 +83,16 @@ def verify(rst, html_expected, latex_expected):
def test_inline():
# correct interpretation of code with whitespace
- _html = ('<p><tt class="(samp )?docutils literal"><span class="pre">'
- 'code</span>&nbsp;&nbsp; <span class="pre">sample</span></tt></p>')
+ _html = ('<p><code class="(samp )?docutils literal"><span class="pre">'
+ 'code</span>&nbsp;&nbsp; <span class="pre">sample</span></code></p>')
yield verify_re, '``code sample``', _html, r'\\code{code sample}'
yield verify_re, ':samp:`code sample`', _html, r'\\code{code sample}'
# interpolation of braces in samp and file roles (HTML only)
yield (verify, ':samp:`a{b}c`',
- '<p><tt class="samp docutils literal"><span class="pre">a</span>'
+ '<p><code class="samp docutils literal"><span class="pre">a</span>'
'<em><span class="pre">b</span></em>'
- '<span class="pre">c</span></tt></p>',
+ '<span class="pre">c</span></code></p>',
'\\code{a\\emph{b}c}')
# interpolation of arrows in menuselection
@@ -115,8 +115,8 @@ def test_inline():
yield verify, '"John"', '<p>&#8220;John&#8221;</p>', "``John''"
# ... but not in literal text
yield (verify, '``"John"``',
- '<p><tt class="docutils literal"><span class="pre">'
- '&quot;John&quot;</span></tt></p>',
+ '<p><code class="docutils literal"><span class="pre">'
+ '&quot;John&quot;</span></code></p>',
'\\code{"John"}')
# verify classes for inline roles