Autogenerate a single reference page in baseDir. Script only knows how to do this for /enums/ pages, at present. - baseDir - base directory to emit page into - pi - pageInfo for this page relative to file - file - list of strings making up the file, indexed by pi
(baseDir, pi, file)
| 621 | |
| 622 | |
| 623 | def autoGenEnumsPage(baseDir, pi, file): |
| 624 | """Autogenerate a single reference page in baseDir. |
| 625 | |
| 626 | Script only knows how to do this for /enums/ pages, at present. |
| 627 | |
| 628 | - baseDir - base directory to emit page into |
| 629 | - pi - pageInfo for this page relative to file |
| 630 | - file - list of strings making up the file, indexed by pi""" |
| 631 | pageName = f'{baseDir}/{pi.name}{conventions.file_suffix}' |
| 632 | fp = open(pageName, 'w', encoding='utf-8') |
| 633 | |
| 634 | # Add a dictionary entry for this page |
| 635 | global genDict |
| 636 | genDict[pi.name] = None |
| 637 | logDiag('autoGenEnumsPage:', pageName) |
| 638 | |
| 639 | # Short description |
| 640 | if pi.desc is None: |
| 641 | pi.desc = '(no short description available)' |
| 642 | |
| 643 | # Description text. Allow for the case where an enum definition |
| 644 | # is not embedded. |
| 645 | if not pi.embed: |
| 646 | embedRef = '' |
| 647 | else: |
| 648 | embedRef = ''.join(( |
| 649 | ' * The reference page for ', |
| 650 | macroPrefix(pi.embed), |
| 651 | ', where this interface is defined.\n')) |
| 652 | |
| 653 | txt = ''.join(( |
| 654 | 'For more information, see:\n\n', |
| 655 | embedRef, |
| 656 | ' * The See Also section for other reference pages using this type.\n', |
| 657 | f' * The {apiName} Specification.\n')) |
| 658 | |
| 659 | refPageHead(pageName=pi.name, |
| 660 | pageDesc=pi.desc, |
| 661 | pageAliases=pi.alias, |
| 662 | specText=''.join(file[pi.begin:pi.include + 1]), |
| 663 | fieldName=None, |
| 664 | fieldText=None, |
| 665 | descText=txt, |
| 666 | fp=fp) |
| 667 | refPageTail(pageName=pi.name, |
| 668 | specType=pi.spec, |
| 669 | specAnchor=pi.anchor, |
| 670 | seeAlso=seeAlsoList(apiName=pi.name, explicitRefs=pi.xrefs, apiAliases=pi.alias), |
| 671 | fp=fp, |
| 672 | auto=True) |
| 673 | fp.close() |
| 674 | |
| 675 | |
| 676 | # Pattern to break apart an API *Flags{authorID} name, used in |
no test coverage detected