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)
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))), ]
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))), ], ], ' : ')
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))), ]
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)
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) )
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) )
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) )
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) )
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) )
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) )
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), ]
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 row(type_doc: TypeDocumentation) -> List[docs.TableCell]: return [ docs.text_cell(type_doc.singular_name_text), docs.text_cell(type_doc.single_line_description()), ]
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), ]
def row(type_doc: TypeDocumentation) -> List[docs.TableCell]: return [ docs.text_cell(type_doc.name().singular), docs.text_cell(type_doc.single_line_description()), ]
def prop_row(header: str, value_str_or_text) -> List[docs.TableCell]: return [ docs.text_cell(header), docs.text_cell(value_str_or_text), ]
def row(names: EntityTypeNames) -> List[docs.TableCell]: return [ docs.text_cell(doc_format.syntax_text(names.identifier)), docs.text_cell(names.name.plural.capitalize()), ]