[Python-checkins] Syntax highlight IDLE html doc code example. (GH-12981)

Miss Islington (bot) webhook-mailer at python.org
Sat Apr 27 02:26:31 EDT 2019


https://github.com/python/cpython/commit/5d90954856cc1d999dd5d153b807055fde0d53ea
commit: 5d90954856cc1d999dd5d153b807055fde0d53ea
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-04-26T20:42:05-07:00
summary:

Syntax highlight IDLE html doc code example. (GH-12981)


The new markup is currently ignored by IDLE's tk doc display.
(cherry picked from commit 55d035113dfb1bd90495c8571758f504ae8d4802)

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>

files:
M Doc/library/idle.rst
M Lib/idlelib/help.html

diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 11e137bf1092..ad4491128326 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -724,11 +724,9 @@ to begin after the next tab stop. (They occur every 8 'characters').  Newline
 characters cause following text to appear on a new line.  Other control
 characters are ignored or displayed as a space, box, or something else,
 depending on the operating system and font.  (Moving the text cursor through
-such output with arrow keys may exhibit some surprising spacing behavior.)
+such output with arrow keys may exhibit some surprising spacing behavior.) ::
 
-.. code-block:: none
-
-   >>> s = 'a\tb\a<\x02><\r>\bc\nd'
+   >>> s = 'a\tb\a<\x02><\r>\bc\nd'  # Enter 22 chars.
    >>> len(s)
    14
    >>> s  # Display repr(s)
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
index b654ab7f2c5f..7e743e6d8137 100644
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -6,7 +6,7 @@
   <head>
     <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>IDLE — Python 3.8.0a1 documentation</title>
+    <title>IDLE — Python 3.8.0a3 documentation</title>
     <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
@@ -19,7 +19,7 @@
     <script type="text/javascript" src="../_static/sidebar.js"></script>
 
     <link rel="search" type="application/opensearchdescription+xml"
-          title="Search within Python 3.8.0a1 documentation"
+          title="Search within Python 3.8.0a3 documentation"
           href="../_static/opensearch.xml"/>
     <link rel="author" title="About these documents" href="../about.html" />
     <link rel="index" title="Index" href="../genindex.html" />
@@ -72,7 +72,7 @@ <h3>Navigation</h3>
 
 
     <li>
-      <a href="../index.html">3.8.0a1 Documentation</a> »
+      <a href="../index.html">3.8.0a3 Documentation</a> »
     </li>
 
           <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
@@ -372,8 +372,8 @@ <h3>Help menu (Shell and Editor)<a class="headerlink" href="#help-menu-shell-and
 <dt>Go to file/line</dt>
 <dd>Same as in Debug menu.</dd>
 </dl>
-<p>The Shell window also has an output squeezing facility explained in the
-the <em>Python Shell window</em> subsection below.</p>
+<p>The Shell window also has an output squeezing facility explained in the <em>Python
+Shell window</em> subsection below.</p>
 <dl class="docutils">
 <dt>Squeeze</dt>
 <dd>If the cursor is over an output line, squeeze all the output between
@@ -673,24 +673,22 @@ <h3>User output in Shell<a class="headerlink" href="#user-output-in-shell" title
 In contrast, some system text windows only keep the last n lines of output.
 A Windows console, for instance, keeps a user-settable 1 to 9999 lines,
 with 300 the default.</p>
-<p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints)
-in the the BMP (Basic Multilingual Plane) subset of Unicode.
-Which characters are displayed with a proper glyph and which with a
-replacement box depends on the operating system and installed fonts.
-Tab characters cause the following text to begin after
-the next tab stop. (They occur every 8 ‘characters’).
-Newline characters cause following text to appear on a new line.
-Other control characters are ignored or displayed as a space, box, or
-something else, depending on the operating system and font.
-(Moving the text cursor through such output with arrow keys may exhibit
-some surprising spacing behavior.)</p>
-<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>>>> s = 'a\tb\a<\x02><\r>\bc\nd'
->>> len(s)
-14
->>> s  # Display repr(s)
-'a\tb\x07<\x02><\r>\x08c\nd'
->>> print(s, end='')  # Display s as is.
-# Result varies by OS and font.  Try it.
+<p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints) in
+the BMP (Basic Multilingual Plane) subset of Unicode.  Which characters are
+displayed with a proper glyph and which with a replacement box depends on the
+operating system and installed fonts.  Tab characters cause the following text
+to begin after the next tab stop. (They occur every 8 ‘characters’).  Newline
+characters cause following text to appear on a new line.  Other control
+characters are ignored or displayed as a space, box, or something else,
+depending on the operating system and font.  (Moving the text cursor through
+such output with arrow keys may exhibit some surprising spacing behavior.)</p>
+<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="s1">'a</span><span class="se">\t</span><span class="s1">b</span><span class="se">\a</span><span class="s1"><</span><span class="se">\x02</span><span class="s1">><</span><span class="se">\r</span><span class="s1">></span><span class="se">\b</span><span class="s1">c</span><span class="se">\n</span><span class="s1">d'</span>  <span class="c1"># Enter 22 chars.</span>
+<span class="gp">>>> </span><span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
+<span class="go">14</span>
+<span class="gp">>>> </span><span class="n">s</span>  <span class="c1"># Display repr(s)</span>
+<span class="go">'a\tb\x07<\x02><\r>\x08c\nd'</span>
+<span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">end</span><span class="o">=</span><span class="s1">''</span><span class="p">)</span>  <span class="c1"># Display s as is.</span>
+<span class="go"># Result varies by OS and font.  Try it.</span>
 </pre></div>
 </div>
 <p>The <code class="docutils literal notranslate"><span class="pre">repr</span></code> function is used for interactive echo of expression
@@ -912,7 +910,7 @@ <h3>Navigation</h3>
 
 
     <li>
-      <a href="../index.html">3.8.0a1 Documentation</a> »
+      <a href="../index.html">3.8.0a3 Documentation</a> »
     </li>
 
           <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
@@ -943,7 +941,7 @@ <h3>Navigation</h3>
 <br />
     <br />
 
-    Last updated on Feb 23, 2019.
+    Last updated on Apr 26, 2019.
     <a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
     <br />
 



More information about the Python-checkins mailing list