def collections_from_dict(dic):
    """
    construct a Jekyll yaml collection (a dictionary) from a menu dict
    example input:  {'ReadingNotes': ['Book_NeuralNetworksAndDeepLearning', 'test']}
    example output:  {'ReadingNotes_Book_NeuralNetworksAndDeepLearning': {'output': True,
    'permalink': '/ReadingNotes/Book_NeuralNetworksAndDeepLearning/:path'},
    'ReadingNotes_test': {'output': True, 'permalink': '/ReadingNotes/test/:path'}}
    """
    collection = {}
    for k, v in dic.items():
        menu_name_en = k
        for collection_directory in v:
            menu_iterm = 'collection_' + menu_name_en + '_' + collection_directory
            permalink = '/{0}/{1}/:path'.format(menu_name_en, collection_directory)
            collection[menu_iterm] = {'output': True, 'permalink': permalink}
    return collection