MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / refPageTail

Function refPageTail

scripts/genRef.py:364–452  ·  view source on GitHub ↗

Generate end boilerplate of a reference page. - pageName - name of the page - specType - None or the 'spec' attribute from the refpage block, identifying the specification name and URL this refpage links to. - specAnchor - None or the 'anchor' attribute from the refpage block,

(pageName,
                specType=None,
                specAnchor=None,
                seeAlso=None,
                fp=None,
                auto=False,
                leveloffset=0)

Source from the content-addressed store, hash-verified

362
363
364def refPageTail(pageName,
365 specType=None,
366 specAnchor=None,
367 seeAlso=None,
368 fp=None,
369 auto=False,
370 leveloffset=0):
371 """Generate end boilerplate of a reference page.
372
373 - pageName - name of the page
374 - specType - None or the 'spec' attribute from the refpage block,
375 identifying the specification name and URL this refpage links to.
376 - specAnchor - None or the 'anchor' attribute from the refpage block,
377 identifying the anchor in the specification this refpage links to. If
378 None, the pageName is assumed to be a valid anchor.
379 - seeAlso - text of the "See Also" section
380 - fp - file to write the page to
381 - auto - True if this is an entirely generated refpage, False if it is
382 handwritten content from the spec.
383
384 - leveloffset - number of levels to bias section titles up or down."""
385
386 specName = conventions.api_name(specType)
387 specURL = conventions.specURL(specType)
388 if specAnchor is None:
389 specAnchor = pageName
390
391 if seeAlso is None:
392 seeAlso = 'No cross-references are available\n'
393
394 # Create reference to the Specification document from which this refpage
395 # was extracted.
396
397 global remapState
398 if remapState.antora:
399 # Determine which page anchor this anchor comes from.
400 # If it cannot be determined, use the unmapped anchor.
401 # This happens for e.g. SPIR-V keywords like 'BaryCoordKHR', which
402 # have their own refpage but no anchor.
403
404 module = remapState.module
405
406 try:
407 (pageAnchor, _) = remapState.pageMap[specAnchor]
408 pageName = remapState.xrefMap[pageAnchor]
409 specref = f'xref:{module}{pageName}#{specAnchor}[{specName} Specification]'
410 except:
411 logWarn(f'refPageTail: cannot determine specification page containing {specAnchor}')
412
413 specref = f'xref:{module}index.adoc[{specName} Specification] (NOTE: cannot determine Specification page containing this refpage)'
414 else:
415 specref = f'link:{specURL}#{specAnchor}[{specName} Specification^]'
416
417 notes = [
418 f'For more information, see the {specref}.',
419 '',
420 ]
421

Callers 5

emitPageFunction · 0.85
autoGenEnumsPageFunction · 0.85
autoGenFlagsPageFunction · 0.85
autoGenHandlePageFunction · 0.85
genExtensionFunction · 0.85

Calls 5

logWarnFunction · 0.90
printFooterFunction · 0.85
api_nameMethod · 0.45
specURLMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected