Lines Matching refs:anchor

43 titleAnchorPat = re.compile(r'^\[\[(?P<anchor>[^,]+).*\]\]$')
61 def mapAnchor(anchor, title, pageMap, xrefMap, closeAnchor):
62 """Rewrite a <<anchor{, title}>> xref -> xref:pagemap#anchor[{title}]
63 - anchor - anchor name
65 anchor text from the xrefMap is used if available
70 #@if anchor == 'features-shaderStorageImageReadWithoutFormat':
74 # Determine which page anchor this anchor comes from
75 # If it cannot be determined, use the unmapped anchor
76 #@ Simplify the page anchor if pageName == current page
81 (pageAnchor, _) = xrefMap[anchor]
83 # No explicit title. Infer one from anchor and xrefMap.
84 (pageAnchor, title) = xrefMap[anchor]
87 # the anchor name
89 print(f'No title found for anchor {anchor}', file=sys.stderr)
90 title = anchor
92 # Page the page anchor comes from
94 print(f'mapAnchor: anchor {anchor} pageAnchor {pageAnchor} -> pageName = {pageName}')
96 xref = f'{pageName}#{anchor}'
98 print(f'Cannot determine which page {anchor} comes from, passing through to Antora intact', file=sys.stderr)
99 xref = f'{anchor}'
110 """Rewrite <<anchor,text>> to xref:newanchor[text]
111 - match - match object, \1 = anchor, \2 = text
115 anchor = match.group(1)
118 return mapAnchor(anchor, text, pageMap, xrefMap, closeAnchor=True)
121 """Rewrite <<anchor>> to xref:newanchor[]
122 - match - match object, \1 = anchor
126 anchor = match.group(1)
128 return mapAnchor(anchor, '', pageMap, xrefMap, closeAnchor=True)
131 """Rewrite <<anchor, to xref:newanchor[
132 - match - match object, \1 = anchor, \2 = text (may be empty)
136 anchor = match.group(1)
139 return mapAnchor(anchor, text, pageMap, xrefMap, closeAnchor=False)
158 - titleAnchor - page title anchor for Pages, else ''
161 - pageMap - dictionary mapping a page anchor to a source file
163 - xrefMap - dictionary mapping an anchor within a page to a page
164 anchor
188 asciidoc title, preceded immediately by an anchor for the page.
191 Partials title and '' if no title anchor is found."""
196 """Default, if page title and/or page anchor not found"""
203 # Look for the first anchor, which must precede the title to
207 titleAnchor = match.group('anchor')
292 - xrefMap - map from anchors within a page to the page anchor"""
300 # anchor text. Track whether the closing >> is being looked for at
320 # including remapping the anchor.
322 # First, complete xrefs with alt-text (<<anchor, text>>)
327 # Next, complete xrefs without alt-text (<<anchor>>)
332 # Finally, if there is a trailing '<<anchor,' at EOL, remap it
476 # help='Specify HTML of generated spec to extract anchor mapping from')
539 # Save mapping from page anchor to its relpath