docx2html/core.py
def create_list(list_type):
    """
    Based on the passed in list_type create a list objects (ol/ul). In the
    future this function will also deal with what the numbering of an ordered
    list should look like.
    """
    list_types = {
        'bullet': 'ul',
    }
    el = etree.Element(list_types.get(list_type, 'ol'))
    # These are the supported list style types and their conversion to css.
    list_type_conversions = {
        'decimal': DEFAULT_LIST_NUMBERING_STYLE,
        'decimalZero': 'decimal-leading-zero',
        'upperRoman': 'upper-roman',
        'lowerRoman': 'lower-roman',
        'upperLetter': 'upper-alpha',
        'lowerLetter': 'lower-alpha',
        'ordinal': DEFAULT_LIST_NUMBERING_STYLE,
        'cardinalText': DEFAULT_LIST_NUMBERING_STYLE,
        'ordinalText': DEFAULT_LIST_NUMBERING_STYLE,
    }
    if list_type != 'bullet':
        el.set(
            'data-list-type',
            list_type_conversions.get(list_type, DEFAULT_LIST_NUMBERING_STYLE),
        )
    return el
def create_list(list_type):
    """
    Based on the passed in list_type create a list objects (ol/ul). In the
    future this function will also deal with what the numbering of an ordered
    list should look like.
    """
    list_types = {
        'bullet': 'ul',
    }
    el = etree.Element(list_types.get(list_type, 'ol'))
    # These are the supported list style types and their conversion to css.
    list_type_conversions = {
        'decimal': DEFAULT_LIST_NUMBERING_STYLE,
        'decimalZero': 'decimal-leading-zero',
        'upperRoman': 'upper-roman',
        'lowerRoman': 'lower-roman',
        'upperLetter': 'upper-alpha',
        'lowerLetter': 'lower-alpha',
        'ordinal': DEFAULT_LIST_NUMBERING_STYLE,
        'cardinalText': DEFAULT_LIST_NUMBERING_STYLE,
        'ordinalText': DEFAULT_LIST_NUMBERING_STYLE,
    }
    if list_type != 'bullet':
        el.set(
            'data-list-type',
            list_type_conversions.get(list_type, DEFAULT_LIST_NUMBERING_STYLE),
        )
    return el
def create_list ( list_type ) : list_types = { 'bullet' : 'ul' , } el = etree . Element ( list_types . get ( list_type , 'ol' ) ) # These are the supported list style types and their conversion to css. list_type_conversions = { 'decimal' : DEFAULT_LIST_NUMBERING_STYLE , 'decimalZero' : 'decimal-leading-zero' , 'upperRoman' : 'upper-roman' , 'lowerRoman' : 'lower-roman' , 'upperLetter' : 'upper-alpha' , 'lowerLetter' : 'lower-alpha' , 'ordinal' : DEFAULT_LIST_NUMBERING_STYLE , 'cardinalText' : DEFAULT_LIST_NUMBERING_STYLE , 'ordinalText' : DEFAULT_LIST_NUMBERING_STYLE , } if list_type != 'bullet' : el . set ( 'data-list-type' , list_type_conversions . get ( list_type , DEFAULT_LIST_NUMBERING_STYLE ) , ) return el
Based on the passed in list_type create a list objects (ol/ul). In the
    future this function will also deal with what the numbering of an ordered
    list should look like.
Based on the passed in list_type create a list objects ( ol / ul ) . In the future this function will also deal with what the numbering of an ordered list should look like .