#!/usr/bin/env python # coding: utf-8 # # SUMMARY notebook # # This notebook scans the directory in which it lives to find all jupyter notebooks (other than itself) in that directory. It then prints for every notebook it finds (1) a hyperlink to the notebook, and (2) the first cell (which is always markdown) of the notebook. This way you can read a nice, automatically generated summary of all the notebooks without having to open all of them. If you find a notebook that you want to explore further, you can simply click on its link to open it. # In[1]: # Version: 2 import os import json from IPython.display import display, Markdown # the name of this file this_fname = 'SUMMARY.ipynb' fname_to_md = {} for fname in sorted([x for x in os.listdir('./')]): if fname[-6:] == '.ipynb' and fname != this_fname: # print('------------', fname) with open(fname, 'r', encoding="utf-8") as f: fdata = json.load(f) fname_to_md[fname] = ''.join(fdata['cells'][0]['source']) # print(fname_to_md) pre_sep = '\n\n
\n\n' full_md = '' k = 1 num_nb = len(fname_to_md) project_name ="qubiter" who ="artiste-qb-net" where = "qubiter/jupyter_notebooks" for fname, md in fname_to_md.items(): sep = pre_sep local_link = f' [local link] ' github_link = f' [github link] ' sep += fname + local_link + github_link + str(k) + '/' + str(num_nb) + '\n\n' full_md += sep + md k += 1 display(Markdown(full_md))