Skip to content

Commit

Permalink
Improve nbviewer URL calculation in make_readme.py
Browse files Browse the repository at this point in the history
Should now work for directories anywhere in repo.
  • Loading branch information
douglatornell committed Oct 7, 2021
1 parent ca5a1d4 commit 7afa817
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion github_notebooks_readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ Here is a prototype :file:`make_readme.py` module that provides that automation:
def main():
url = f"{NBVIEWER}/{GITHUB_ORG}/{REPO_NAME}/blob/{DEFAULT_BRANCH_NAME}/{Path.cwd().name}"
cwd_parts = Path.cwd().parts
repo_path = Path(*cwd_parts[cwd_parts.index(REPO_NAME)+1:])
url = f"{NBVIEWER}/{GITHUB_ORG}/{REPO_NAME}/blob/{DEFAULT_BRANCH_NAME}/{repo_path}"
readme = f"""\
The Jupyter Notebooks in this directory are made by
Expand Down

0 comments on commit 7afa817

Please sign in to comment.