コード例 #1
0
ファイル: param.py プロジェクト: MarkTseng/docs-tools
def generate_param_fields(param):
    _name = [ param['field']['type'] ]

    if ParamTable.has_type(param):
        _name.append(process_type_cell(param['type'], 'field'))

    if param['name'] is not None:
        _name.append(param['name'])

    description = param['description']

    if isinstance( param['description'], list):
        field_content = fill('\n'.join(param['description']), 0, 6, False)
    else:
        field_content = fill(param['description'], 0, 6, False)

    return ' '.join(_name), field_content
コード例 #2
0
def generate_param_fields(param):
    _name = [param['field']['type']]

    if ParamTable.has_type(param):
        _name.append(process_type_cell(param['type'], 'field'))

    if param['name'] is not None:
        _name.append(param['name'])

    description = param['description']

    if isinstance(param['description'], list):
        field_content = fill('\n'.join(param['description']), 0, 6, False)
    else:
        field_content = fill(param['description'], 0, 6, False)

    return ' '.join(_name), field_content
コード例 #3
0
def process_description(content, optional=False):
    if isinstance(content, list):
        if not content[11:] == 'Optional. ' and optional is True:
            content[0] = 'Optional.\n' + content[0]
        return content
    else:
        if not content[11:] == 'Optional. ' and optional is True:
            o = 'Optional. '
        else:
            o = ''
        return fill(o + content, hanging=3, wrap=False)
コード例 #4
0
ファイル: param.py プロジェクト: RandomStuffs22/docs-tools
def process_description(content, optional=False):
    if isinstance(content, list):
        if not content[11:] == 'Optional. ' and optional is True:
            content[0] = 'Optional.\n' + content[0]
        return content
    else:
        if not content[11:] == 'Optional. ' and optional is True:
            o = 'Optional. '
        else:
            o = ''
        return fill(o + content, hanging=3, wrap=False)