Mercurial > cpython-lru_cache-weakref
comparison Doc/texinputs/python.sty @ 15362:9a17cdcd3320 legacy-trunk
Fix \withsubitem so that it actually works if the only indexing macro in
the content body is the \ttindex macro, which seems to match actual usage.
Adjust \funcline to restore the "index sub-item" for functions to be
" (in module <name>)" instead of " (in <name>)". This is need to match
uses of \withsubitem throughout the documentation. (Not ideal, but
gets achieves consistency.)
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Mon, 30 Oct 2000 06:22:22 +0000 |
| parents | 74e1d79520fd |
| children | 64545c986b98 |
comparison
equal
deleted
inserted
replaced
| 15361:a3af145d2531 | 15362:9a17cdcd3320 |
|---|---|
| 291 \index{#1@{\py@idxcode{#1}}}% | 291 \index{#1@{\py@idxcode{#1}}}% |
| 292 \fi% | 292 \fi% |
| 293 } | 293 } |
| 294 \newcommand{\withsubitem}[2]{% | 294 \newcommand{\withsubitem}[2]{% |
| 295 \begingroup% | 295 \begingroup% |
| 296 \def\index@subitem{#1}% | 296 \def\ttindex##1{\index{##1@{\py@idxcode{##1}} #1}}% |
| 297 \ifpy@usingsubitem% | 297 #2% |
| 298 #2% | |
| 299 \else% | |
| 300 \py@usingsubitemtrue% | |
| 301 #2% | |
| 302 \py@usingsubitemfalse% | |
| 303 \fi | |
| 304 \endgroup% | 298 \endgroup% |
| 305 } | 299 } |
| 306 | 300 |
| 307 | 301 |
| 308 % Module synopsis processing ----------------------------------------------- | 302 % Module synopsis processing ----------------------------------------------- |
| 581 \item[\bfcode{#1}\index{#1@{\py@idxcode{#1}} (macro)}] | 575 \item[\bfcode{#1}\index{#1@{\py@idxcode{#1}} (macro)}] |
| 582 }{\end{fulllineitems}} | 576 }{\end{fulllineitems}} |
| 583 | 577 |
| 584 % simple functions (not methods) ----------------------------------------- | 578 % simple functions (not methods) ----------------------------------------- |
| 585 % \begin{funcdesc}{name}{args} | 579 % \begin{funcdesc}{name}{args} |
| 586 \newcommand{\funcline}[2]{\funclineni{#1}{#2}% | 580 \newcommand{\funcline}[2]{% |
| 587 \index{#1@{\py@idxcode{#1()}} (in \py@thismodule)}} | 581 \funclineni{#1}{#2}% |
| 582 \index{#1@{\py@idxcode{#1()}} (in module \py@thismodule)}} | |
| 588 \newenvironment{funcdesc}[2]{ | 583 \newenvironment{funcdesc}[2]{ |
| 589 \begin{fulllineitems} | 584 \begin{fulllineitems} |
| 590 \funcline{#1}{#2} | 585 \funcline{#1}{#2} |
| 591 }{\end{fulllineitems}} | 586 }{\end{fulllineitems}} |
| 592 | 587 |
