def visit_reference(self, node): if self.in_subnav and 'subnav-toggle' in node['classes']: toggle = nodes.raw( '', '<b class="dropdown-toggle caret" data-toggle="dropdown"></b>') toggle['format'] = 'html' node.append(toggle) SphinxHTMLTranslator.visit_reference(self, node)
def visit_reference(self, node): if node.hasattr('refuri') and node['refuri'].find( 'GAUGE_LATEST_VERSION_PLACEHOLDER') >= 0: refuri = node.attributes['refuri'] node.attributes['refuri'] = refuri.replace( 'GAUGE_LATEST_VERSION_PLACEHOLDER', environ.get('GAUGE_LATEST_VERSION')) HTMLTranslator.visit_reference(self, node)
def visit_github_object_link_node(translator: HTMLTranslator, node: GitHubObjectLinkNode): """ Visit a :class:`~.GitHubObjectLinkNode`. :param translator: :param node: The node being visited. """ translator.body.append(f'<b class="github-object">') translator.visit_reference(node)
def visit_issue_node(translator: HTMLTranslator, node: IssueNode): """ Visit an :class:`~.IssueNode`. If the node points to a valid issue / pull request, add a tooltip giving the title of the issue / pull request and a hyperlink to the page on GitHub. :param translator: :param node: The node being visited. """ issue_title = get_issue_title(node.issue_url) if issue_title: node.has_tooltip = True translator.body.append(f'<abbr title="{issue_title}">') translator.visit_reference(node) else: warnings.warn(f"Issue/Pull Request #{node.issue_number} not found.")
def visit_reference(self, node): if False == node.get('translated', True): self.body.append('<span class="no-translated">') HTMLTranslator.visit_reference(self, node)