当前位置: 首页>>代码示例>>Python>>正文


Python nodes.citation方法代码示例

本文整理汇总了Python中docutils.nodes.citation方法的典型用法代码示例。如果您正苦于以下问题:Python nodes.citation方法的具体用法?Python nodes.citation怎么用?Python nodes.citation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在docutils.nodes的用法示例。


在下文中一共展示了nodes.citation方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: citation

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def citation(self, match):
        src, srcline = self.state_machine.get_source_and_line()
        indented, indent, offset, blank_finish = \
              self.state_machine.get_first_known_indented(match.end())
        label = match.group(1)
        name = normalize_name(label)
        citation = nodes.citation('\n'.join(indented))
        citation.source = src
        citation.line = srcline
        citation += nodes.label('', label)
        citation['names'].append(name)
        self.document.note_citation(citation)
        self.document.note_explicit_target(citation, citation)
        if indented:
            self.nested_parse(indented, input_offset=offset, node=citation)
        return [citation], blank_finish 
开发者ID:skarlekar,项目名称:faces,代码行数:18,代码来源:states.py

示例2: depart_citation_reference

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def depart_citation_reference(self, node):
        if self._use_latex_citations:
            followup_citation = False
            # check for a following citation separated by a space or newline
            next_siblings = node.traverse(descend=False, siblings=True,
                                          include_self=False)
            if len(next_siblings) > 1:
                next = next_siblings[0]
                if (isinstance(next, nodes.Text) and
                    next.astext() in (' ', '\n')):
                    if next_siblings[1].__class__ == node.__class__:
                        followup_citation = True
            if followup_citation:
                self.out.append(',')
            else:
                self.out.append('}')
                self.inside_citation_reference_label = False
        else:
            self.out.append(']}') 
开发者ID:skarlekar,项目名称:faces,代码行数:21,代码来源:__init__.py

示例3: visit_label

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_label(self, node):
        # footnote and citation
        if (isinstance(node.parent, nodes.footnote)
            or isinstance(node.parent, nodes.citation)):
            raise nodes.SkipNode
        self.document.reporter.warning('"unsupported "label"',
                base_node=node)
        self.body.append('[') 
开发者ID:skarlekar,项目名称:faces,代码行数:10,代码来源:manpage.py

示例4: visit_title_reference

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_title_reference(self, node):
        """inline citation reference"""
        self.body.append(self.defs['title_reference'][0]) 
开发者ID:skarlekar,项目名称:faces,代码行数:5,代码来源:manpage.py

示例5: depart_caption

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def depart_caption(self, node):
        self.body.append('</p>\n')

    # citations
    # ---------
    # Use definition list instead of table for bibliographic references.
    # Join adjacent citation entries. 
开发者ID:skarlekar,项目名称:faces,代码行数:9,代码来源:_html_base.py

示例6: visit_citation

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_citation(self, node):
        if not self.in_footnote_list:
            self.body.append('<dl class="citation">\n')
            self.in_footnote_list = True 
开发者ID:skarlekar,项目名称:faces,代码行数:6,代码来源:_html_base.py

示例7: visit_citation_reference

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_citation_reference(self, node):
        href = '#'
        if 'refid' in node:
            href += node['refid']
        elif 'refname' in node:
            href += self.document.nameids[node['refname']]
        # else: # TODO system message (or already in the transform)?
        # 'Citation reference missing.'
        self.body.append(self.starttag(
            node, 'a', '[', CLASS='citation-reference', href=href)) 
开发者ID:skarlekar,项目名称:faces,代码行数:12,代码来源:_html_base.py

示例8: depart_inline

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def depart_inline(self, node):
        self.body.append('</span>')

    # footnote and citation labels: 
开发者ID:skarlekar,项目名称:faces,代码行数:6,代码来源:_html_base.py

示例9: visit_label

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_label(self, node):
        if (isinstance(node.parent, nodes.footnote)):
            classes = self.settings.footnote_references
        else:
            classes = 'brackets'
        # pass parent node to get id into starttag:
        self.body.append(self.starttag(node.parent, 'dt', '', CLASS='label'))
        self.body.append(self.starttag(node, 'span', '', CLASS=classes))
        # footnote/citation backrefs:
        if self.settings.footnote_backlinks:
            backrefs = node.parent['backrefs']
            if len(backrefs) == 1:
                self.body.append('<a class="fn-backref" href="#%s">'
                                 % backrefs[0]) 
开发者ID:skarlekar,项目名称:faces,代码行数:16,代码来源:_html_base.py

示例10: depart_footnote_reference

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def depart_footnote_reference(self, node):
        self.out.append(self.context.pop())

    # footnote/citation label 
开发者ID:skarlekar,项目名称:faces,代码行数:6,代码来源:__init__.py

示例11: visit_label

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import citation [as 别名]
def visit_label(self, node):
        """footnote or citation label: in brackets or as superscript"""
        self.label_delim(node, '[', '\\textsuperscript{') 
开发者ID:skarlekar,项目名称:faces,代码行数:5,代码来源:__init__.py


注:本文中的docutils.nodes.citation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。