示例#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
文件: doc.py 项目: emilkarlen/exactly
 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
文件: doc.py 项目: emilkarlen/exactly
    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),
    ]
 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
文件: hds.py 项目: emilkarlen/exactly
 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()),
     ]