Пример #1
0
    def _types_table() -> docs.ParagraphItem:
        def type_row(type_info: TypeNameAndCrossReferenceId) -> list:
            type_syntax_info = syntax.ANY_TYPE_INFO_DICT[type_info.value_type]

            first_column = docs.text_cell(syntax_text(type_info.identifier))

            if type_info.value_type == ValueType.STRING:
                arg = a.Choice(a.Multiplicity.MANDATORY,
                               [instruction_arguments.STRING,
                                instruction_arguments.HERE_DOCUMENT])
                second_column = [arg]
            else:
                second_column = type_syntax_info.value_arguments

            return [
                first_column,
                docs.text_cell(syntax_text(cl_syntax.cl_syntax_for_args(second_column))),
            ]

        rows = [
            [
                docs.text_cell(syntax.TYPE_SYNTAX_ELEMENT),
                docs.text_cell(syntax.VALUE_SYNTAX_ELEMENT),
            ]
        ]

        rows += map(type_row, types.ALL_TYPES_INFO_TUPLE)

        return docs.first_row_is_header_table(rows)
Пример #2
0
 def type_row(ts: TypeSetup) -> List[TableCell]:
     return [
         docs.text_cell(syntax_text(ts.type_info.identifier)),
         docs.text_cell(
             syntax_text(
                 cl_syntax.cl_syntax_for_args(ts.value_arguments))),
     ]
Пример #3
0
def _symbol_reference_syntax_table() -> ParagraphItem:
    return docs.first_column_is_header_table([
        [
            docs.text_cell('Plain name'),
            docs.text_cell(
                syntax_text(
                    syntax_elements.SYMBOL_NAME_SYNTAX_ELEMENT.argument.name)),
        ],
        [
            docs.text_cell('Special syntax'),
            docs.text_cell(
                syntax_text(
                    symbol_reference_syntax_for_name(
                        syntax_elements.SYMBOL_NAME_SYNTAX_ELEMENT.argument.
                        name))),
        ],
    ], ' : ')
Пример #4
0
        def type_row(type_info: TypeNameAndCrossReferenceId) -> list:
            type_syntax_info = syntax.ANY_TYPE_INFO_DICT[type_info.value_type]

            first_column = docs.text_cell(syntax_text(type_info.identifier))

            if type_info.value_type == ValueType.STRING:
                arg = a.Choice(a.Multiplicity.MANDATORY,
                               [instruction_arguments.STRING,
                                instruction_arguments.HERE_DOCUMENT])
                second_column = [arg]
            else:
                second_column = type_syntax_info.value_arguments

            return [
                first_column,
                docs.text_cell(syntax_text(cl_syntax.cl_syntax_for_args(second_column))),
            ]
Пример #5
0
    def _types_table() -> docs.ParagraphItem:
        def type_row(ts: TypeSetup) -> List[TableCell]:
            return [
                docs.text_cell(syntax_text(ts.type_info.identifier)),
                docs.text_cell(
                    syntax_text(
                        cl_syntax.cl_syntax_for_args(ts.value_arguments))),
            ]

        rows = [[
            docs.text_cell(syntax.TYPE_SYNTAX_ELEMENT),
            docs.text_cell(syntax.VALUE_SYNTAX_ELEMENT),
        ]]

        rows += map(type_row, type_setup.TYPE_SETUPS_LIST)

        return docs.first_row_is_header_table(rows)
Пример #6
0
 def _options_for_current_directory(self) -> List[ParagraphItem]:
     return ([
                 docs.first_row_is_header_table([
                     [docs.text_cell(REL_CWD_INFO.option_name_text)]
                 ])
             ]
             +
             self._parser.fnap(_REL_CD_DESCRIPTION)
             )
Пример #7
0
 def _options_for_current_directory(self) -> List[ParagraphItem]:
     return ([
                 docs.first_row_is_header_table([
                     [docs.text_cell(REL_CWD_INFO.option_name_text)]
                 ])
             ]
             +
             self._parser.fnap(_REL_CD_DESCRIPTION)
             )
Пример #8
0
 def _options_for_rel_source_file(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(REL_source_file_dir_OPTION)),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SOURCE_FILE_DESCRIPTION)
             )
Пример #9
0
 def _options_for_symbol(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(render_argument(REL_SYMBOL_OPTION))),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SYMBOL_DESCRIPTION)
             )
Пример #10
0
 def _options_for_rel_source_file(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(REL_source_file_dir_OPTION)),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SOURCE_FILE_DESCRIPTION)
             )
Пример #11
0
 def _options_for_symbol(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(render_argument(REL_SYMBOL_OPTION))),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SYMBOL_DESCRIPTION)
             )
Пример #12
0
 def row(names: EntityTypeNames) -> List[docs.TableCell]:
     return [
         docs.text_cell(doc_format.syntax_text(names.identifier)),
         docs.text_cell(names.name.plural.capitalize()),
     ]
 def _dir_row(self, tc_dir_info: TcDirInfo) -> List[docs.TableCell]:
     return [
         docs.text_cell(tc_dir_info.informative_name),
         docs.text_cell(tc_dir_info.single_line_description_str),
     ]
Пример #14
0
def _mk_dir_info_row(dir_info: RelOptionInfo) -> list:
    return [
        docs.text_cell(dir_info.option_name_text),
        docs.text_cell(dir_info.informative_name),
    ]
Пример #15
0
 def row(type_doc: TypeDocumentation) -> List[docs.TableCell]:
     return [
         docs.text_cell(type_doc.singular_name_text),
         docs.text_cell(type_doc.single_line_description()),
     ]
Пример #16
0
def _mk_dir_info_row(dir_info: RelOptionInfo) -> list:
    return [
        docs.text_cell(dir_info.option_name_text),
        docs.text_cell(dir_info.informative_name),
    ]
Пример #17
0
 def prop_row(header: str, value_str_or_text) -> List[docs.TableCell]:
     return [docs.text_cell(header),
             docs.text_cell(value_str_or_text),
             ]
Пример #18
0
 def row(type_doc: TypeDocumentation) -> List[docs.TableCell]:
     return [
         docs.text_cell(type_doc.name().singular),
         docs.text_cell(type_doc.single_line_description()),
     ]
Пример #19
0
 def prop_row(header: str, value_str_or_text) -> List[docs.TableCell]:
     return [
         docs.text_cell(header),
         docs.text_cell(value_str_or_text),
     ]
Пример #20
0
 def row(names: EntityTypeNames) -> List[docs.TableCell]:
     return [
         docs.text_cell(doc_format.syntax_text(names.identifier)),
         docs.text_cell(names.name.plural.capitalize()),
     ]