################################### Create Readme ####################################
def plot_titles(titles):
    return '\n' + "## " + titles[0] + '\n'


list_types = [["Classics", "Classic"], ["Empirical Study", "Empirical"],
              ["Surveys", "Survey", "survey"], ["Influentials", "Influential"],
              ["New Settings or Metrics", "Setting", "Metric"],
              ["Regularization Methods", "Regularization"],
              ["Distillation Methods", "Distillation"],
              ["Rehearsal Methods", "Rehearsal"],
              ["Generative Replay Methods", "Generative Replay"],
              [
                  "Dynamic Architectures or Routing Methods", "Architectures",
                  "Dynamic Architecture"
              ], ["Hybrid Methods", "Hybrid"],
              ["Continual Few-Shot Learning", "Continual-Meta Learning"],
              ["Meta-Continual Learning"],
              ["Lifelong Reinforcement Learning", "Reinforcement"],
              ["Continual Generative Modeling", "Generative Modeling"],
              ["Applications"], ["Thesis"], ["Libraries", "Library"],
              ["Workshops", 'Workshop']]

generate_md_file(DB=bib_db,
                 list_classif=list_types,
                 key="keywords",
                 plot_title_fct=plot_titles,
                 filename="README.md",
                 add_comments=True)
conferences_list = [["ICLR", "International Conference on Learning Representations"],
               ["CVPR", "Conference on Computer Vision and Pattern Recognition"],
               ["ICCV", "International Conference on Computer Vision"],
               ["ECCV", "European Conference on Computer Vision"],
               ["NeuriPS", "NIPS", "Neural Information Processing Systems"],
               ["ICML", "International Conference on Machine Learning"],
               ["IJCAI", "International Joint Conference on Artificial Intelligence"],
               ["IJCNN", "International Joint Conference on Neural Networks"],
               ["ICANN", "International Conference on Artificial Neural Networks"]]

output_file = os.path.join("Mardown_Files", "Conferences_Bibliography.md")
generate_md_file(DB=bib_db,
                 list_classif=conferences_list,
                 key="booktitle",
                 plot_title_fct=plot_conf_title,
                 filename=output_file,
                 url=repository_url,
                 bibfile=bibfile_name,
                 add_comments=False)


################################### SORT BY AUTHORS ####################################

def plot_years_title(year):
    return '\n' + "## Papers in " + year[0] + '\n'


years = []
for i in range(1950, 2021):
    years.append([str(i)])
years.reverse()