Commit 55d03511 authored by Terry Jan Reedy's avatar Terry Jan Reedy Committed by GitHub

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

The new markup is currently ignored by IDLE's tk doc display.
parent 6d13e5b3
...@@ -724,11 +724,9 @@ to begin after the next tab stop. (They occur every 8 'characters'). Newline ...@@ -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 cause following text to appear on a new line. Other control
characters are ignored or displayed as a space, box, or something else, characters are ignored or displayed as a space, box, or something else,
depending on the operating system and font. (Moving the text cursor through 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' # Enter 22 chars.
>>> s = 'a\tb\a<\x02><\r>\bc\nd'
>>> len(s) >>> len(s)
14 14
>>> s # Display repr(s) >>> s # Display repr(s)
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<head> <head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>IDLE &#8212; Python 3.8.0a1 documentation</title> <title>IDLE &#8212; Python 3.8.0a3 documentation</title>
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<script type="text/javascript" src="../_static/sidebar.js"></script> <script type="text/javascript" src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml" <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"/> href="../_static/opensearch.xml"/>
<link rel="author" title="About these documents" href="../about.html" /> <link rel="author" title="About these documents" href="../about.html" />
<link rel="index" title="Index" href="../genindex.html" /> <link rel="index" title="Index" href="../genindex.html" />
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<li> <li>
<a href="../index.html">3.8.0a1 Documentation</a> &#187; <a href="../index.html">3.8.0a3 Documentation</a> &#187;
</li> </li>
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
...@@ -372,8 +372,8 @@ debugger. Breakpoints for a file are saved in the user’s .idlerc directory.</ ...@@ -372,8 +372,8 @@ debugger. Breakpoints for a file are saved in the user’s .idlerc directory.</
<dt>Go to file/line</dt> <dt>Go to file/line</dt>
<dd>Same as in Debug menu.</dd> <dd>Same as in Debug menu.</dd>
</dl> </dl>
<p>The Shell window also has an output squeezing facility explained in the <p>The Shell window also has an output squeezing facility explained in the <em>Python
the <em>Python Shell window</em> subsection below.</p> Shell window</em> subsection below.</p>
<dl class="docutils"> <dl class="docutils">
<dt>Squeeze</dt> <dt>Squeeze</dt>
<dd>If the cursor is over an output line, squeeze all the output between <dd>If the cursor is over an output line, squeeze all the output between
...@@ -673,24 +673,22 @@ output to Shell will eventually fill memory, resulting in a memory error. ...@@ -673,24 +673,22 @@ output to Shell will eventually fill memory, resulting in a memory error.
In contrast, some system text windows only keep the last n lines of output. 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, A Windows console, for instance, keeps a user-settable 1 to 9999 lines,
with 300 the default.</p> with 300 the default.</p>
<p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints) <p>A Tk Text widget, and hence IDLE’s Shell, displays characters (codepoints) in
in the the BMP (Basic Multilingual Plane) subset of Unicode. the BMP (Basic Multilingual Plane) subset of Unicode. Which characters are
Which characters are displayed with a proper glyph and which with a displayed with a proper glyph and which with a replacement box depends on the
replacement box depends on the operating system and installed fonts. operating system and installed fonts. Tab characters cause the following text
Tab characters cause the following text to begin after to begin after the next tab stop. (They occur every 8 ‘characters’). Newline
the next tab stop. (They occur every 8 ‘characters’). characters cause following text to appear on a new line. Other control
Newline characters cause following text to appear on a new line. characters are ignored or displayed as a space, box, or something else,
Other control characters are ignored or displayed as a space, box, or depending on the operating system and font. (Moving the text cursor through
something else, depending on the operating system and font. such output with arrow keys may exhibit some surprising spacing behavior.)</p>
(Moving the text cursor through such output with arrow keys may exhibit <div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="s1">&#39;a</span><span class="se">\t</span><span class="s1">b</span><span class="se">\a</span><span class="s1">&lt;</span><span class="se">\x02</span><span class="s1">&gt;&lt;</span><span class="se">\r</span><span class="s1">&gt;</span><span class="se">\b</span><span class="s1">c</span><span class="se">\n</span><span class="s1">d&#39;</span> <span class="c1"># Enter 22 chars.</span>
some surprising spacing behavior.)</p> <span class="gp">&gt;&gt;&gt; </span><span class="nb">len</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>&gt;&gt;&gt; s = &#39;a\tb\a&lt;\x02&gt;&lt;\r&gt;\bc\nd&#39; <span class="go">14</span>
&gt;&gt;&gt; len(s) <span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="c1"># Display repr(s)</span>
14 <span class="go">&#39;a\tb\x07&lt;\x02&gt;&lt;\r&gt;\x08c\nd&#39;</span>
&gt;&gt;&gt; s # Display repr(s) <span class="gp">&gt;&gt;&gt; </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">&#39;&#39;</span><span class="p">)</span> <span class="c1"># Display s as is.</span>
&#39;a\tb\x07&lt;\x02&gt;&lt;\r&gt;\x08c\nd&#39; <span class="go"># Result varies by OS and font. Try it.</span>
&gt;&gt;&gt; print(s, end=&#39;&#39;) # Display s as is.
# Result varies by OS and font. Try it.
</pre></div> </pre></div>
</div> </div>
<p>The <code class="docutils literal notranslate"><span class="pre">repr</span></code> function is used for interactive echo of expression <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 @@ also used for testing.</p> ...@@ -912,7 +910,7 @@ also used for testing.</p>
<li> <li>
<a href="../index.html">3.8.0a1 Documentation</a> &#187; <a href="../index.html">3.8.0a3 Documentation</a> &#187;
</li> </li>
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
...@@ -943,7 +941,7 @@ also used for testing.</p> ...@@ -943,7 +941,7 @@ also used for testing.</p>
<br /> <br />
<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>? <a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br /> <br />
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment