mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Label classes and exceptions explicitly in the documentation (for their
*desc environments).
This commit is contained in:
		
							parent
							
								
									0539bfaaa4
								
							
						
					
					
						commit
						ab357ecf7f
					
				
					 2 changed files with 19 additions and 17 deletions
				
			
		|  | @ -882,7 +882,7 @@ sub do_env_excdesc{ | ||||||
|     local($_) = @_; |     local($_) = @_; | ||||||
|     my $excname = next_argument(); |     my $excname = next_argument(); | ||||||
|     my $idx = make_str_index_entry("<tt class='exception'>$excname</tt>"); |     my $idx = make_str_index_entry("<tt class='exception'>$excname</tt>"); | ||||||
|     return "<dl><dt><b>$idx</b>\n<dd>" . $_ . '</dl>' |     return "<dl><dt><b>exception $idx</b>\n<dd>" . $_ . '</dl>' | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| sub do_env_fulllineitems{ return do_env_itemize(@_); } | sub do_env_fulllineitems{ return do_env_itemize(@_); } | ||||||
|  | @ -895,7 +895,9 @@ sub handle_classlike_descriptor{ | ||||||
|     $idx = make_str_index_entry( |     $idx = make_str_index_entry( | ||||||
| 		"<tt class='$what'>$THIS_CLASS</tt> ($what in $THIS_MODULE)" ); | 		"<tt class='$what'>$THIS_CLASS</tt> ($what in $THIS_MODULE)" ); | ||||||
|     $idx =~ s/ \(.*\)//; |     $idx =~ s/ \(.*\)//; | ||||||
|     return "<dl><dt><b>$idx</b> (<var>$arg_list</var>)\n<dd>" . $_ . '</dl>'; |     return ("<dl><dt><b>$what $idx</b> (<var>$arg_list</var>)\n<dd>" | ||||||
|  |             . $_ | ||||||
|  |             . '</dl>'); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| sub do_env_classdesc{ | sub do_env_classdesc{ | ||||||
|  |  | ||||||
|  | @ -598,7 +598,7 @@ | ||||||
|   % Using \renewcommand doesn't work for this, for unknown reasons: |   % Using \renewcommand doesn't work for this, for unknown reasons: | ||||||
|   \global\def\py@thisclass{#1} |   \global\def\py@thisclass{#1} | ||||||
|   \begin{fulllineitems} |   \begin{fulllineitems} | ||||||
|     \item[\code{\bfcode{#1}(\py@varvars{#2})}% |     \item[\strong{class }\code{\bfcode{#1}(\py@varvars{#2})}% | ||||||
|       \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] |       \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] | ||||||
| }{\end{fulllineitems}} | }{\end{fulllineitems}} | ||||||
| 
 | 
 | ||||||
|  | @ -608,7 +608,7 @@ | ||||||
|   % Using \renewcommand doesn't work for this, for unknown reasons: |   % Using \renewcommand doesn't work for this, for unknown reasons: | ||||||
|   \global\def\py@thisclass{#1} |   \global\def\py@thisclass{#1} | ||||||
|   \begin{fulllineitems} |   \begin{fulllineitems} | ||||||
|     \item[\code{\bfcode{#1}(\py@varvars{#2})}% |     \item[\strong{exception }\code{\bfcode{#1}(\py@varvars{#2})}% | ||||||
|       \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] |       \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] | ||||||
| }{\end{fulllineitems}} | }{\end{fulllineitems}} | ||||||
| 
 | 
 | ||||||
|  | @ -678,7 +678,7 @@ | ||||||
| %  -- for constructor information, use excclassdesc instead | %  -- for constructor information, use excclassdesc instead | ||||||
| \newenvironment{excdesc}[1]{ | \newenvironment{excdesc}[1]{ | ||||||
|   \begin{fulllineitems} |   \begin{fulllineitems} | ||||||
|     \item[\bfcode{#1}% |     \item[\strong{exception }\bfcode{#1}% | ||||||
|           \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] |           \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] | ||||||
| }{\end{fulllineitems}} | }{\end{fulllineitems}} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fred Drake
						Fred Drake