nbdev-template icon indicating copy to clipboard operation
nbdev-template copied to clipboard

How to point `nbdev_new` at a different template?

Open dsm-72 opened this issue 2 years ago • 5 comments

dsm-72 avatar Jun 07 '23 14:06 dsm-72

@seeM is this possible?

dsm-72 avatar Jun 07 '23 14:06 dsm-72

This isn't currently supported via the nbdev_new command. I would consider one of these two solutions, with a preference for the first:

  1. If I wanted more control over nbdev_new in an organization, I would personally consider implementing my own version of it, by copy-pasting the existing implementation. My reasons are: (1) it's quite likely that your own template will drift even further as you customize it to your own needs, and (2) it's a relatively small and simple function.
  2. If you think your version won't be that different, you could make a PR to add this functionality to nbdev. One approach would be to add a repo argument, expected to be of the format org/repo (currently hardcoded to fastai/nbdev-template) and use that instead of the currently hard-coded values here.

seeM avatar Jun 07 '23 15:06 seeM

@seeM I can understand one. However that seems tedious for multiple devices. I think adding a repo for option isn't that bad of an idea.

dsm-72 avatar Jun 07 '23 15:06 dsm-72

What do you mean by "tedious for multiple devices"? I would host it in a package on the organization's private PyPI server so each user would only need to pip install <org>-nbdev and then do <org>-nbdev-new.

seeM avatar Jun 07 '23 15:06 seeM

@seeM replace "tedious" with "I don't use GitHub to its full potential (e.g. tags) and it would take time to learn that as well as get collaborators to learn to do that pip install change since it is hard enough to get some to use git, let alone environments"

dsm-72 avatar Jun 07 '23 15:06 dsm-72