Esempio n. 1
0
 def _see_also_sections(
         self,
         environment: ConstructionEnvironment) -> List[doc.SectionItem]:
     type_info = types.VALUE_TYPE_2_TYPES_INFO_DICT[
         self.builtin_doc.value_type]
     targets = [type_info.cross_reference_target] + list(
         self.builtin_doc.see_also)
     return see_also_sections(targets, environment)
Esempio n. 2
0
 def _sub_sections(self, environment: ConstructionEnvironment) -> List[doc.SectionItem]:
     ret_val = []
     append_section_if_contents_is_non_empty(ret_val,
                                             'Description',
                                             self.syntax_element.main_description_rest())
     ret_val += see_also_sections(self.syntax_element.see_also_targets(), environment,
                                  uppercase_title=False)
     return ret_val
Esempio n. 3
0
 def _sub_sections(
         self,
         environment: ConstructionEnvironment) -> List[doc.SectionItem]:
     ret_val = []
     append_section_if_contents_is_non_empty(
         ret_val, headers.DESCRIPTION__HEADER__CAPITALIZED,
         self.syntax_element.main_description_rest())
     ret_val += text_utils.maybe_section(headers.NOTES__HEADER__CAPITALIZED,
                                         self.syntax_element.notes())
     ret_val += see_also_sections(self.syntax_element.see_also_targets(),
                                  environment,
                                  uppercase_title=False)
     return ret_val
Esempio n. 4
0
    def apply(self, program: CliProgramSyntaxDocumentation) -> docs.SectionContents:
        initial_paragraphs = [docs.para(program.description().single_line_description)]
        initial_paragraphs += program.initial_paragraphs()

        sections = [self._synopsis_section(program)]
        sections += self._description_sections(program)
        sections += self._options_sections(program.argument_descriptions())
        sections += self._files_sections(program.files())
        sections += self._outcome_sections(program.outcome(self.environment))
        sections += see_also_sections(program.see_also(), self.environment, True)

        return docs.SectionContents(initial_paragraphs,
                                    sections)
Esempio n. 5
0
 def apply(self, environment: ConstructionEnvironment) -> doc.ArticleContents:
     srd = self.suite_reporter
     initial_paragraphs = srd.main_description_rest()
     initial_paragraphs.extend(self._default_reporter_info())
     sub_sections = []
     names_and_contents = [
         ('Output syntax', srd.syntax_of_output()),
         ('Exit code', srd.exit_code_description()),
     ]
     append_sections_if_contents_is_non_empty(sub_sections, names_and_contents)
     sub_sections += see_also_sections(srd.see_also_targets(), environment)
     return doc.ArticleContents(docs.paras(srd.single_line_description()),
                                doc.SectionContents(initial_paragraphs,
                                                    sub_sections))
Esempio n. 6
0
    def apply(self, environment: ConstructionEnvironment) -> doc.ArticleContents:
        self.rendering_environment = environment

        initial_paragraphs = self._default_reporter_info()
        initial_paragraphs.extend(self.actor.main_description_rest())
        sub_sections = []
        append_sections_if_contents_is_non_empty(
            sub_sections,
            [(self._parser.format('{act_phase} phase contents'), self.actor.act_phase_contents()),
             (self._parser.format('Syntax of {act_phase} phase contents'), self.actor.act_phase_contents_syntax())])
        sub_sections += see_also_sections(self.actor.see_also_targets(), environment)
        return doc.ArticleContents(docs.paras(self.actor.single_line_description()),
                                   doc.SectionContents(initial_paragraphs,
                                                       sub_sections))
Esempio n. 7
0
 def apply(self, environment: ConstructionEnvironment) -> doc.ArticleContents:
     documentation = self.documentation
     sub_sections = []
     if documentation.invokation_variants():
         sub_sections.append(synopsis_section(
             invokation_variants_content(documentation.instruction_name(),
                                         documentation.invokation_variants(),
                                         documentation.syntax_element_descriptions())))
     sub_sections += self._main_description_rest_sections()
     sub_sections += see_also_sections(documentation.see_also_targets(), environment,
                                       uppercase_title=True)
     abstract_paragraphs = docs.paras(self.documentation.single_line_description())
     return doc.ArticleContents(abstract_paragraphs,
                                doc.SectionContents([], sub_sections))
Esempio n. 8
0
    def apply(self,
              program: CliProgramSyntaxDocumentation) -> docs.SectionContents:
        initial_paragraphs = [
            docs.para(program.description().single_line_description)
        ]
        initial_paragraphs += program.initial_paragraphs()

        sections = [self._synopsis_section(program)]
        sections += self._description_sections(program)
        sections += self._options_sections(program.argument_descriptions())
        sections += self._files_sections(program.files())
        sections += self._outcome_sections(program.outcome(self.environment))
        sections += see_also_sections(program.see_also(), self.environment,
                                      True)

        return docs.SectionContents(initial_paragraphs, sections)
Esempio n. 9
0
    def apply(self, environment: ConstructionEnvironment) -> doc.ArticleContents:
        sub_sections = []

        if self.doc.invokation_variants():
            sub_sections.append(synopsis_section(
                invokation_variants_content(None,
                                            self.doc.invokation_variants(),
                                            [])))
        append_section_if_contents_is_non_empty(sub_sections,
                                                'Description',
                                                self.doc.main_description_rest())
        sub_sections += see_also_sections(self.doc.see_also_targets(),
                                          environment,
                                          uppercase_title=True)
        return doc.ArticleContents(docs.paras(self.doc.single_line_description()),
                                   doc.SectionContents([],
                                                       sub_sections))
Esempio n. 10
0
    def apply(self,
              environment: ConstructionEnvironment) -> doc.ArticleContents:
        sub_sections = []

        if self.doc.invokation_variants():
            sub_sections.append(
                synopsis_section(
                    invokation_variants_content(None,
                                                self.doc.invokation_variants(),
                                                self.doc.syntax_elements())))
        append_section_if_contents_is_non_empty(
            sub_sections, 'Description', self.doc.main_description_rest())
        sub_sections += see_also_sections(self.doc.see_also_targets(),
                                          environment,
                                          uppercase_title=True)
        return doc.ArticleContents(
            docs.paras(self.doc.single_line_description()),
            doc.SectionContents([], sub_sections))
Esempio n. 11
0
    def apply(self, environment: ConstructionEnvironment) -> doc.ArticleContents:
        self.rendering_environment = environment

        initial_paragraphs = self._default_reporter_info()
        initial_paragraphs.extend(self.actor.main_description_rest())
        sub_sections = []
        append_sections_if_contents_is_non_empty(
            sub_sections,
            [
                (self._parser.format('{act_phase} phase contents'), self.actor.act_phase_contents()),
                (self._parser.format('Syntax of {act_phase} phase contents'), self.actor.act_phase_contents_syntax()),
                (headers.NOTES__HEADER__CAPITALIZED, self.actor.notes()),
            ]
        )
        sub_sections += see_also_sections(self.actor.see_also_targets(), environment)
        return doc.ArticleContents(docs.paras(self.actor.single_line_description()),
                                   doc.SectionContents(initial_paragraphs,
                                                       sub_sections))
Esempio n. 12
0
 def apply(self,
           environment: ConstructionEnvironment) -> doc.ArticleContents:
     documentation = self.documentation
     sub_sections = []
     if documentation.invokation_variants():
         sub_sections.append(
             synopsis_section(
                 invokation_variants_content(
                     documentation.instruction_name(),
                     documentation.invokation_variants(),
                     documentation.syntax_element_descriptions())))
     sub_sections += self._main_description_rest_sections()
     sub_sections += self._outcome()
     sub_sections += self._notes()
     sub_sections += see_also_sections(documentation.see_also_targets(),
                                       environment,
                                       uppercase_title=True)
     abstract_paragraphs = docs.paras(
         self.documentation.single_line_description())
     return doc.ArticleContents(abstract_paragraphs,
                                doc.SectionContents([], sub_sections))
Esempio n. 13
0
 def apply(self,
           environment: ConstructionEnvironment) -> doc.SectionContents:
     initial_paragraphs = TEXT_PARSER.fnap(REPORTING)
     sub_sections = see_also.see_also_sections(_SEE_ALSO_TARGETS,
                                               environment)
     return doc.SectionContents(initial_paragraphs, sub_sections)
Esempio n. 14
0
 def _see_also_sections(self, environment: ConstructionEnvironment) -> list:
     return render_utils.see_also_sections(self.conf_param.see_also_targets(),
                                           environment)
Esempio n. 15
0
 def _add_section_for_see_also(self, environment: ConstructionEnvironment,
                               sections: List[docs.SectionItem]):
     sections += see_also_sections(self._doc.see_also_targets, environment)
Esempio n. 16
0
 def _see_also_sections(self, environment: ConstructionEnvironment) -> List[docs.SectionItem]:
     return render_utils.see_also_sections(self.concept.see_also_targets(),
                                           environment)
Esempio n. 17
0
 def _see_also_sections(self, environment: ConstructionEnvironment) -> List[docs.SectionItem]:
     return render_utils.see_also_sections(self.concept.see_also_targets(),
                                           environment)
Esempio n. 18
0
 def _see_also_sections(self, environment: ConstructionEnvironment) -> list:
     return render_utils.see_also_sections(
         self.conf_param.see_also_targets(), environment)
Esempio n. 19
0
 def _add_section_for_see_also(self, environment: ConstructionEnvironment,
                               output: List[docs.SectionItem]):
     output += see_also_sections(self.doc.see_also_targets, environment)
Esempio n. 20
0
 def apply(self, environment: ConstructionEnvironment) -> doc.SectionContents:
     initial_paragraphs = TEXT_PARSER.fnap(REPORTING)
     sub_sections = see_also.see_also_sections(_SEE_ALSO_TARGETS,
                                               environment)
     return doc.SectionContents(initial_paragraphs,
                                sub_sections)
Esempio n. 21
0
 def _add_section_for_see_also(self, environment: ConstructionEnvironment, output: List[docs.SectionItem]):
     output += see_also_sections(self.doc.see_also_targets, environment)