我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用docutils.nodes.Decorative()。
def apply(self): if not getattr(self.document.settings, 'docinfo_xform', 1): return document = self.document index = document.first_child_not_matching_class( nodes.PreBibliographic) if index is None: return candidate = document[index] if isinstance(candidate, nodes.field_list): biblioindex = document.first_child_not_matching_class( (nodes.Titular, nodes.Decorative)) nodelist = self.extract_bibliographic(candidate) nodelist[0].realsource = candidate.realsource del document[index] # untransformed field list (candidate) document[biblioindex:biblioindex] = nodelist
def apply(self): if not getattr(self.document.settings, 'docinfo_xform', 1): return document = self.document index = document.first_child_not_matching_class( nodes.PreBibliographic) if index is None: return candidate = document[index] if isinstance(candidate, nodes.field_list): biblioindex = document.first_child_not_matching_class( (nodes.Titular, nodes.Decorative)) nodelist = self.extract_bibliographic(candidate) del document[index] # untransformed field list (candidate) document[biblioindex:biblioindex] = nodelist