mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Create the module index only if a conditional is true.
This commit is contained in:
parent
54b03b85f7
commit
3455edcbc8
2 changed files with 14 additions and 6 deletions
|
@ -261,14 +261,18 @@
|
||||||
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
|
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
|
||||||
|
|
||||||
% support for the module index
|
% support for the module index
|
||||||
\newwrite\modindexfile
|
\if@usemoduleindex
|
||||||
\openout\modindexfile=mod\jobname.idx
|
\newwrite\modindexfile
|
||||||
|
\openout\modindexfile=mod\jobname.idx
|
||||||
|
\fi
|
||||||
|
|
||||||
% Add the defining entry for a module
|
% Add the defining entry for a module
|
||||||
\newcommand{\defmodindex}[2]{%
|
\newcommand{\defmodindex}[2]{%
|
||||||
\index{#1@{\idxcode{#1}} (#2module)|textbf}%
|
\index{#1@{\idxcode{#1}} (#2module)|textbf}%
|
||||||
\setindexsubitem{(in module #1)}%
|
\setindexsubitem{(in module #1)}%
|
||||||
\write\modindexfile{#1 \thepage}}
|
\if@usemoduleindex%
|
||||||
|
\write\modindexfile{#1 \thepage}%
|
||||||
|
\fi}
|
||||||
|
|
||||||
% built-in & Python modules in the main distribution
|
% built-in & Python modules in the main distribution
|
||||||
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
|
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
|
||||||
|
|
|
@ -261,14 +261,18 @@
|
||||||
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
|
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
|
||||||
|
|
||||||
% support for the module index
|
% support for the module index
|
||||||
\newwrite\modindexfile
|
\if@usemoduleindex
|
||||||
\openout\modindexfile=mod\jobname.idx
|
\newwrite\modindexfile
|
||||||
|
\openout\modindexfile=mod\jobname.idx
|
||||||
|
\fi
|
||||||
|
|
||||||
% Add the defining entry for a module
|
% Add the defining entry for a module
|
||||||
\newcommand{\defmodindex}[2]{%
|
\newcommand{\defmodindex}[2]{%
|
||||||
\index{#1@{\idxcode{#1}} (#2module)|textbf}%
|
\index{#1@{\idxcode{#1}} (#2module)|textbf}%
|
||||||
\setindexsubitem{(in module #1)}%
|
\setindexsubitem{(in module #1)}%
|
||||||
\write\modindexfile{#1 \thepage}}
|
\if@usemoduleindex%
|
||||||
|
\write\modindexfile{#1 \thepage}%
|
||||||
|
\fi}
|
||||||
|
|
||||||
% built-in & Python modules in the main distribution
|
% built-in & Python modules in the main distribution
|
||||||
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
|
\newcommand{\bimodindex}[1]{\defmodindex{#1}{built-in }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue