def maybe_section(header: StrOrText, contents: docs.SectionContents) -> List[doc.Section]: return ( [] if contents.is_empty else [docs.Section(header, contents)] )
def _add_section_for_instructions(self, environment: ConstructionEnvironment, output: List[docs.SectionItem]): if self.__section_documentation.has_instructions: renderer = instruction_set_constructor( self.__section_documentation.instruction_set, self._instruction_cross_ref_text, instruction_group_by=self.__section_documentation. instruction_group_by) output.append( docs.Section(self.__instructions_section_header, renderer.apply(environment)))
def apply(self, environment: ConstructionEnvironment) -> doc.SectionContents: sections = [] for test_case_phase_help in self.test_case_help.phase_helps_in_order_of_execution: if test_case_phase_help.has_instructions: renderer = instruction_set_constructor( test_case_phase_help.instruction_set, instruction_group_by=test_case_phase_help. instruction_group_by) sections.append( docs.Section(text(test_case_phase_help.name.syntax), renderer.apply(environment))) return doc.SectionContents([], sections)
def apply(self, environment: ConstructionEnvironment) -> docs.SectionItem: return docs.Section( self._title, self._section_contents_constructor.apply(environment))
def _add_section_for_contents_description(self, output: List[docs.SectionItem]): output.append( docs.Section(self.CONTENTS_HEADER, self._doc.contents_description()))
def _files_sections( files: Optional[docs.SectionContents]) -> List[docs.Section]: if not files: return [] return [docs.Section(docs.text('FILES'), files)]
def _outcome_sections( outcome: Optional[docs.SectionContents]) -> List[docs.Section]: if not outcome: return [] return [docs.Section(docs.text('OUTCOME'), outcome)]