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


Python nodes.rubric方法代码示例

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


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

示例1: run

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import rubric [as 别名]
def run(self):
        idb = nodes.make_id("emva1288-" + self.options['section'])
        section = nodes.section(ids=[idb])
        section += nodes.rubric(text='Emva1288')
        lst = nodes.bullet_list()

        for k in self.option_spec.keys():
            if k not in self.options:
                continue

            item = nodes.list_item()
            item += nodes.strong(text=k + ':')
            item += nodes.inline(text=' ' + self.options[k])
            lst += item
        section += lst
        return [section] 
开发者ID:EMVA1288,项目名称:emva1288,代码行数:18,代码来源:sphinx_directives.py

示例2: run

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import rubric [as 别名]
def run(self):
        clazz = self.arguments[0]
        rubric_title = None
        rubric_elems = None
        rubric_public_elems = None
        try:
            (module_name, class_name) = clazz.rsplit('.', 1)
            m = __import__(module_name, globals(), locals(), [class_name])
            c = getattr(m, class_name)
            if 'methods' in self.options:
                rubric_title = 'Methods'
                _, rubric_elems = self.get_members(self.state.document, c, 'method', ['__init__'])
            elif 'enums' in self.options:
                rubric_title = 'Enums'
                _, rubric_elems = self.get_members(self.state.document, c, 'class', None, False, True)
            elif 'signals' in self.options:
                rubric_title = 'Signals'
                _, rubric_elems = self.get_members(self.state.document, c, 'attribute', None, True)
            elif 'attributes' in self.options:
                rubric_title = 'Attributes'
                _, rubric_elems = self.get_members(self.state.document, c, 'attribute', None, False)

            if rubric_elems:
                rubric_public_elems = list(filter(lambda e: not e.startswith('_'), rubric_elems))
                self.content = ["~%s.%s" % (clazz, elem) for elem in rubric_public_elems]
        except BaseException as e:
            print(str(e))
            raise e
        finally:
            # add the title before the return of the run
            ret = super().run()
            if rubric_title:
                if rubric_public_elems and len(rubric_public_elems) > 0:
                    rub = nodes.rubric('', rubric_title)
                    ret.insert(0, rub)
            return ret 
开发者ID:qgis,项目名称:pyqgis,代码行数:38,代码来源:autoautosummary.py

示例3: genetic_map_section

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import rubric [as 别名]
def genetic_map_section(self, species, genetic_map):
        map_id = self.get_genetic_map_id(species, genetic_map)
        target = self.get_target(map_id)
        section = nodes.section(ids=[map_id])
        section += nodes.title(text=genetic_map.id)
        section += nodes.paragraph(text=genetic_map.long_description)
        section += nodes.rubric(text="Citations")
        section += self.citation_list(genetic_map)
        return [target, section] 
开发者ID:popsim-consortium,项目名称:stdpopsim,代码行数:11,代码来源:speciescatalog.py

示例4: model_section

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import rubric [as 别名]
def model_section(self, species, model):
        mid = self.get_demographic_model_id(species, model)
        target = self.get_target(mid)
        section = nodes.section(ids=[mid])
        section += nodes.title(text=model.description)
        section += nodes.paragraph(text=model.long_description)
        section += nodes.rubric(text="Details")
        section += self.model_summary(model)
        section += nodes.rubric(text="Populations")
        section += self.population_table(model)
        section += nodes.rubric(text="Citations")
        section += self.citation_list(model)
        section += nodes.rubric(text="Demographic Model parameters")
        section += self.model_parameter_table(species, model)
        return [target, section] 
开发者ID:popsim-consortium,项目名称:stdpopsim,代码行数:17,代码来源:speciescatalog.py

示例5: run

# 需要导入模块: from docutils import nodes [as 别名]
# 或者: from docutils.nodes import rubric [as 别名]
def run(self):
        set_classes(self.options)
        rubric_text = self.arguments[0]
        textnodes, messages = self.state.inline_text(rubric_text, self.lineno)
        rubric = nodes.rubric(rubric_text, '', *textnodes, **self.options)
        self.add_name(rubric)
        return [rubric] + messages 
开发者ID:skarlekar,项目名称:faces,代码行数:9,代码来源:body.py


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