(self)
| 601 | return self.document.traverse(condition) |
| 602 | |
| 603 | def apply(self): |
| 604 | env = self.document.settings.env |
| 605 | |
| 606 | # Find CMake cross-reference nodes and add index and target |
| 607 | # nodes for them. |
| 608 | for ref in self._document_findall_as_list(addnodes.pending_xref): |
| 609 | if not ref['refdomain'] == 'cmake': |
| 610 | continue |
| 611 | |
| 612 | objtype = ref['reftype'] |
| 613 | make_index_entry = _cmake_index_objs.get(objtype) |
| 614 | if not make_index_entry: |
| 615 | continue |
| 616 | |
| 617 | objname = ref['reftarget'] |
| 618 | if objtype == 'guide' and CMakeXRefRole._re_guide.match(objname): |
| 619 | # Do not index cross-references to guide sections. |
| 620 | continue |
| 621 | |
| 622 | if objtype == 'command': |
| 623 | # Index signature references to their parent command. |
| 624 | objname = objname.split('(')[0].lower() |
| 625 | |
| 626 | targetnum = env.new_serialno(f'index-{objtype}:{objname}') |
| 627 | |
| 628 | targetid = f'index-{targetnum}-{objtype}:{objname}' |
| 629 | targetnode = nodes.target('', '', ids=[targetid]) |
| 630 | self.document.note_explicit_target(targetnode) |
| 631 | |
| 632 | indexnode = addnodes.index() |
| 633 | indexnode['entries'] = [make_index_entry(objname, targetid, '')] |
| 634 | ref.replace_self([indexnode, targetnode, ref]) |
| 635 | |
| 636 | |
| 637 | class CMakeDomain(Domain): |
nothing calls this directly
no test coverage detected