|
261 | 261 | \setindexsubitem{(in module #1)}% |
262 | 262 | \index{#1@{\py@idxcode{#1}} (#2module)|textbf}% |
263 | 263 | \ifpy@UseModuleIndex% |
264 | | - \write\modindexfile{\protect\indexentry{#1@{\texttt {#1}}}{\thepage}}% |
| 264 | + \@ifundefined{py@modplat@\py@thismodulekey}{ |
| 265 | + \write\modindexfile{\protect\indexentry{#1@{\texttt{#1}}}{\thepage}}% |
| 266 | + }{\write\modindexfile{\protect\indexentry{#1@{\texttt{#1} % |
| 267 | + \emph{(\platformof[\py@thismodulekey]{})}}}{\thepage}}% |
| 268 | + } |
265 | 269 | \fi% |
266 | 270 | } |
267 | 271 |
|
|
287 | 291 |
|
288 | 292 | % Module synopsis processing ----------------------------------------------- |
289 | 293 | % |
| 294 | +\newcommand{\py@thisclass}{} |
| 295 | +\newcommand{\py@thismodule}{} |
| 296 | +\newcommand{\py@thismodulekey}{} |
| 297 | +\newcommand{\py@thismoduletype}{} |
| 298 | + |
290 | 299 | \newcommand{\py@standardIndexModule}[1]{\stmodindex{#1}} |
291 | 300 | \newcommand{\py@builtinIndexModule}[1]{\bimodindex{#1}} |
292 | 301 | \newcommand{\py@extensionIndexModule}[1]{\exmodindex{#1}} |
293 | 302 | \newcommand{\py@IndexModule}[1]{\modindex{#1}} |
294 | 303 |
|
295 | | -\newif\ifpy@HaveModSynopsis\py@HaveModSynopsisfalse |
296 | | -\newif\ifpy@ModSynopsisFileIsOpen\py@ModSynopsisFileIsOpenfalse |
| 304 | +\newif\ifpy@HaveModSynopsis \py@HaveModSynopsisfalse |
| 305 | +\newif\ifpy@ModSynopsisFileIsOpen \py@ModSynopsisFileIsOpenfalse |
| 306 | +\newif\ifpy@HaveModPlatform \py@HaveModPlatformfalse |
297 | 307 |
|
298 | 308 | % \declaremodule[key]{type}{name} |
299 | 309 | \newcommand{\declaremodule}[3][\py@modulebadkey]{ |
300 | 310 | \py@openModSynopsisFile |
301 | 311 | \renewcommand{\py@thismoduletype}{#2} |
302 | | - \csname py@#2IndexModule\endcsname{#3} |
303 | 312 | \ifx\py@modulebadkey#1 |
304 | 313 | \renewcommand{\py@thismodulekey}{#3} |
305 | 314 | \else |
306 | 315 | \renewcommand{\py@thismodulekey}{#1} |
307 | 316 | \fi |
| 317 | + \csname py@#2IndexModule\endcsname{#3} |
308 | 318 | \label{module-\py@thismodulekey} |
309 | | - \py@HaveModSynopsistrue |
310 | 319 | } |
| 320 | +\newif\ifpy@ModPlatformFileIsOpen \py@ModPlatformFileIsOpenfalse |
| 321 | +\newcommand{\py@ModPlatformFilename}{\jobname.pla} |
| 322 | +\newcommand{\platform}[1]{ |
| 323 | + \ifpy@ModPlatformFileIsOpen\else |
| 324 | + \newwrite\py@ModPlatformFile |
| 325 | + \openout\py@ModPlatformFile=\py@ModPlatformFilename |
| 326 | + \py@ModPlatformFileIsOpentrue |
| 327 | + \fi |
| 328 | + \@ifundefined{py@modplat@\py@thismodulekey}{ |
| 329 | + \py@writeModPlatformFile{% |
| 330 | + \newcommand{\csname py@modplat@\py@thismodulekey\endcsname}{#1}}% |
| 331 | + }{\py@writeModPlatformFile{% |
| 332 | + \newcommand{\string\py@modplat@\py@thismodulekey}{#1}% |
| 333 | + } |
| 334 | + } |
| 335 | +} |
| 336 | +\InputIfFileExists{\jobname.pla}{}{} |
| 337 | +\newcommand{\platformof}[2][\py@modulebadkey]{% |
| 338 | + \ifx\py@modulebadkey#1 \def\py@key{#2}% |
| 339 | + \else \def\py@key{#1}% |
| 340 | + \fi% |
| 341 | + \csname py@modplat@\py@key\endcsname% |
| 342 | +} |
| 343 | +\newcommand{\ignorePlatformAnnotation}[1]{} |
311 | 344 |
|
312 | 345 | % \moduleauthor{name}{email} |
313 | 346 | \newcommand{\moduleauthor}[2]{} |
|
319 | 352 | \newcommand{\py@defsynopsis}{Module has no synopsis.} |
320 | 353 | \newcommand{\py@modulesynopsis}{\py@defsynopsis} |
321 | 354 | \newcommand{\modulesynopsis}[1]{ |
| 355 | + \py@HaveModSynopsistrue |
322 | 356 | \renewcommand{\py@modulesynopsis}{#1} |
323 | 357 | } |
324 | 358 |
|
|
355 | 389 | } |
356 | 390 | \AtEndDocument{\py@ProcessModSynopsis\py@closeModSynopsisFile} |
357 | 391 |
|
| 392 | + |
| 393 | +\long\def\py@writeModPlatformFile#1{% |
| 394 | + \protected@write\py@ModPlatformFile% |
| 395 | + {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}% |
| 396 | + {\string#1}% |
| 397 | +} |
| 398 | + |
| 399 | + |
358 | 400 | \newcommand{\localmoduletable}{ |
359 | 401 | \IfFileExists{\py@ModSynopsisFilename}{ |
360 | 402 | \begin{synopsistable} |
|
381 | 423 | % -------------------------------------------------------------------------- |
382 | 424 |
|
383 | 425 |
|
384 | | -\newcommand{\py@thisclass}{} |
385 | | -\newcommand{\py@thismodule}{} |
386 | | -\newcommand{\py@thismodulekey}{} |
387 | | -\newcommand{\py@thismoduletype}{} |
388 | | - |
389 | 426 | \newcommand{\py@reset}{ |
390 | 427 | \py@ProcessModSynopsis |
391 | 428 | \renewcommand{\py@thisclass}{} |
|
0 commit comments