diff --git a/py/pytudes.py b/py/pytudes.py index 8ff140d..c2033de 100644 --- a/py/pytudes.py +++ b/py/pytudes.py @@ -1,8 +1,8 @@ # Run "python pytudes.py" to create README.md for pytudes -def bars(items): return '|' + '|'.join(items) + '|' +def cols(items): "Make columns"; return '|' + '|'.join(items) + '|' -def table_head(*columns): return f'{bars(columns)}\n{bars(["---"]*len(columns))}\n' +def table_head(*columns): return f'{cols(columns)}\n{cols(["---"]*len(columns))}\n' def nbs(category, *notebooks): """Make a table of multiple jupyter/ipython notebooks, under a header.""" @@ -11,10 +11,10 @@ def nbs(category, *notebooks): def nb(title, year, url, comment=''): """Make a markdown table entry for a jupyter/ipython notebook.""" - urlb = f'/blob/master/ipynb/{url}' + urlb = f'/blob/main/ipynb/{url}' co = f'[c](https://colab.research.google.com/github/norvig/pytudes{urlb})' - dn = f'[d](https://beta.deepnote.org/launch?template=python_3.6&url=https%3A%2F%2Fgithub.com%2Fnorvig%2Fpytudes%2Fblob%2Fmaster%2Fipynb%2F{url}) ' - my = f'[m](https://mybinder.org/v2/gh/norvig/pytudes/master?filepath=ipynb%2F{url})' + dn = f'[d](https://beta.deepnote.org/launch?template=python_3.6&url=https%3A%2F%2Fgithub.com%2Fnorvig%2Fpytudes%2Fblob%2Fmain%2Fipynb%2F{url}) ' + my = f'[m](https://mybinder.org/v2/gh/norvig/pytudes/main?filepath=ipynb%2F{url})' nb = f'[n](https://nbviewer.jupyter.org/github/norvig/pytudes{urlb})' ti = f'{title}' if year == 2020: year = f'{year}' @@ -28,13 +28,13 @@ def pys(*pyfiles): def py(url, description, doc=''): """Make a markdown table entry for a .py file.""" if doc: doc = f'[documentation]({doc})' - return f'|[{url}](/blob/master/py/{url})|*{description}*|{doc}|' + return f'|[{url}](/blob/main/py/{url})|*{description}*|{doc}|' body = f"""
+