doc2json/tex2json/xml_to_json.py
def build_section_list(sec_id: str, ref_map: Dict) -> List[Tuple]:
    """
    Build list of sections from reference map from sec_id using parent entry recursively
    :param sec_id:
    :param ref_map:
    :return:
    """
    if not sec_id:
        return []
    elif sec_id not in ref_map:
        return []
    else:
        sec_entry = [(ref_map[sec_id]['num'], ref_map[sec_id]['text'])]
        if ref_map[sec_id]['parent'] == sec_id:
            return sec_entry
        else:
            return build_section_list(ref_map[sec_id]['parent'], ref_map) + sec_entry

    Build list of sections from reference map from sec_id using parent entry recursively
    :param sec_id:
    :param ref_map:
    :return:
    
Build list of sections from reference map from sec_id using parent entry recursively
Build list of sections from reference map from sec_id using parent entry recursively
def build_section_list(sec_id: str, ref_map: Dict) -> List[Tuple]:
    if not sec_id:
        return []
    elif sec_id not in ref_map:
        return []
    else:
        sec_entry = [(ref_map[sec_id]['num'], ref_map[sec_id]['text'])]
        if ref_map[sec_id]['parent'] == sec_id:
            return sec_entry
        else:
            return build_section_list(ref_map[sec_id]['parent'], ref_map) + sec_entry
def build_section_list ( sec_id : str , ref_map : Dict ) -> List [ Tuple ] : if not sec_id : return [ ] elif sec_id not in ref_map : return [ ] else : sec_entry = [ ( ref_map [ sec_id ] [ 'num' ] , ref_map [ sec_id ] [ 'text' ] ) ] if ref_map [ sec_id ] [ 'parent' ] == sec_id : return sec_entry else : return build_section_list ( ref_map [ sec_id ] [ 'parent' ] , ref_map ) + sec_entry
Build list of sections from reference map from sec_id using parent entry recursively
Build list of sections from reference map from sec_id using parent entry recursively
"""
    Build list of sections from reference map from sec_id using parent entry recursively
    :param sec_id:
    :param ref_map:
    :return:
    """
None
sec_id
str
None
ref_map
Dict
None