{"id":18952995,"url":"https://github.com/ynab/nbdev_vscode_template","last_synced_at":"2026-03-29T15:30:31.598Z","repository":{"id":229880922,"uuid":"621535889","full_name":"ynab/nbdev_vscode_template","owner":"ynab","description":"Boilerplate repository for getting started with nbdev, with some niceties for VSCode included.","archived":false,"fork":false,"pushed_at":"2023-04-01T18:08:54.000Z","size":320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-01-01T02:42:05.883Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ynab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-30T21:32:41.000Z","updated_at":"2023-03-30T21:33:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"44f8ac04-c954-40a8-af6f-adc943e46f1f","html_url":"https://github.com/ynab/nbdev_vscode_template","commit_stats":null,"previous_names":["ynab/nbdev_vscode_template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynab%2Fnbdev_vscode_template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynab%2Fnbdev_vscode_template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynab%2Fnbdev_vscode_template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ynab%2Fnbdev_vscode_template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ynab","download_url":"https://codeload.github.com/ynab/nbdev_vscode_template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T13:35:35.138Z","updated_at":"2026-03-29T15:30:26.305Z","avatar_url":"https://github.com/ynab.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"NBDev template repository (with VSCode niceities)\n================\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\n# Installation\n\nYou can clone this repo and use it as a template.\n\nOnce cloning it locally, run:\n\n``` sh\n    $ ./bootstrap.sh\n```\n\nThis installs requirements, the [semi-official, but experimental nbdev\nVSCode extension](https://github.com/fastai/nbdev-vscode), and [nbdev\ngit pre-commit hooks](https://nbdev.fast.ai/tutorials/pre_commit.html).\nYou will be prompted for your sudo password because it installs\n[Quarto](https://quarto.org), which needs root access by default.\n¯\\\\*(ツ)*/¯\n\n# Usage\n\n### Editing the README\n\n1.  To get started, open VSCode in this folder: `code .`\n2.  When prompted, install the workspace suggested extensions (like\n    Python, Jupyter, etc)\n3.  Then, open the `nbs/index.ipynb` file in VSCode.\n4.  VSCode might likely prompt you to install Jupyter. That’s cool.\n5.  Edit the index.ipynb file, and watch as it automatically becomes\n    your README.md when you run `nbdev_build_docs`.\n\n### To keep your docs updated as you edit your notebooks, run:\n\n``` sh\n    $ ./scripts/nbdev_preview.sh\n```\n\n### Editing the libraries:\n\nThe other notebooks automatically get converted to .py files when you\nrun `nbdev_build_lib`.\n\n1.  To see how that works, open `00_core.ipynb`.\n2.  run `nbdev_build_lib` to convert it to a .py file.\n3.  Open the `nbdev_vscode_template/core.py` file that was generated.\n4.  Put your cursor in the `say_hello` function and press F12 to jump to\n    the definition of that function in your 00_core.ipynb file. (This is\n    feature of the [nbdev-vscode\n    extension](https://github.com/fastai/nbdev-vscode).)\n5.  Put your cursor in the `add_one` function in the notebook and hit\n    `F12` and see it jump to your function definition in the .py file.\n\n## Committing changes to git\n\nThis repository uses pre-commit hooks to cleanup the notebook before\npushing.\n\n#### Option 1: The simplest way to do things is to run this script to ensure that things are ready to be committed:\n\n``` sh\n    ./scripts/nbdev_prepare.sh\n    # Now git commit as always\n```\n\n#### Option 2: Rely upon pre-commit hooks:\n\nWhen you do a git commit in this repo that has pre-commit hooks\ninstalled, your new workflow will be as follows:\n\n1.  pre-commit runs each hook on your staged changes (as in, changes\n    that you git added)\n2.  If a hook changes files – for example, if a commited notebook wasn’t\n    cleaned – pre-commit stops the commit, leaving those changes as\n    unstaged. (This won’t happen if you use nbdev_prepare!)\n3.  You can now stage those changes and make any edits required to get\n    pre-commit to pass\n4.  Redo the git commit, and if it succeeds, your commit will be\n    created.\n5.  Using it in practice isn’t as complicated as it might sound. The\n    best way to figure out if it works for you is to give it a try.\n\nIf you have questions, see [this documentation about nbdev\npre_commit](https://nbdev.fast.ai/tutorials/pre_commit.html)\n\n### More details on nbdev:\n\nFor more on nbdev usage, follow the [nbdev\ntutorial](https://nbdev.fast.ai/tutorials/tutorial.html).\n\n# Github Actions\n\nWhen you push changes to your github repo, you’ll see three actions run.\n(These actions are defined inside of `.github/workflows`)\n\n1.  `test` (this is the main CI step that runs each of your notebooks. A\n    test is just a cell executing without an exception.)\n2.  `Deploy to Github Pages` (builds your Github pages to the `gh-pages`\n    branch.)\n3.  `pages-build-deployment` (Automatically run when your gh-pages\n    branch updates, to deploy your built pages to your site. )\n\nIf you want to see your Github pages hosted publicly, you’ll want to\n[enable Github Pages in your repo\nsettings](https://nbdev.fast.ai/tutorials/tutorial.html#check-out-your-docs).\n\n## Notebooks all the way down…\n\nThis README, just like everything else in nbdev, is authored in a\nnotebook. That means we can do cool stuff like run code in the notebook,\nand have the output show up in the readme, like this:\n\n``` python\nsay_hello(\"world\")\n```\n\n    'Hello world!'\n\nOr this:\n\n``` python\n# Show an image of a cat:\nfrom IPython.display import Image\nImage(url=\"https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg\")\n```\n\n\u003cimg src=\"https://www.catster.com/wp-content/uploads/2017/08/A-fluffy-cat-looking-funny-surprised-or-concerned.jpg\"/\u003e\n\n## TODO\n\n- [ ] Figure out how console scripts work in settings.ini and add\n  bootstrap to that.\n- [ ] Figure out the proper order of setup.py stuff and the bootstrap.sh\n  stuff. (Should bootstrap.sh just be something that setup.py runs? I am\n  a Python noob.)\n- [ ] Show how to use https://github.com/benbalter/jekyll-auth to use\n  private Github pages for private repos (without having to upgrade to\n  Github Enterprise)\n- [ ] When the [NBDev-VSCode\n  extension](https://github.com/fastai/nbdev-vscode) gets published, add\n  it as a recommended extension.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynab%2Fnbdev_vscode_template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fynab%2Fnbdev_vscode_template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fynab%2Fnbdev_vscode_template/lists"}