-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore using a cookiecutter for the site #87
Comments
Yes. I think that would be an improvement. I just found myself a few days ago trying to start one of these again and being confused about what I am supposed to do (e.g., which files are optional and which ones are required). |
cc @yuvipanda who I think has a good eye for user-interface design! do you have any thoughts on the above? |
hmmm, I'm a bit worried that cookiecutter won't work here, this is primarily because cookiecutter uses liquid templates, which also use the That seems like enough addition of complexity that cookiecutter isn't quite worth it. Moreover it seems that patches to cookiecutter will take a looong time to get merged, as the author(s) don't seem super invested in it in terms of time. :-/ Another optionKeep the book in a template-like form but a bit more light-weight than what cookiecutter uses. Split out the
You'd create a new jupyter book using a pattern like:
In this case, we'd use ruamel to let the user give their own YAML configuration. This would simply update the fields that are in |
@choldgraf said this to me in person yesterday and I like it! |
I like this too. I think that a CLI would be good. You might even make it
ask questions (doesn't cookiecutter do that?), instead of having to enter
in command-line arguments. WDYT?
…On Wed, Jan 23, 2019 at 11:32 AM Yuvi Panda ***@***.***> wrote:
@choldgraf <https://github.com/choldgraf> said this to me in person
yesterday and I like it!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHPNjggjFK8gxYIGh-9yu2OpCPAdt_3ks5vGLiygaJpZM4aJbq2>
.
|
cool, will prototype something soon! |
see #89 |
Sorry for the delay! I was reading and thinking that this sounds like it would need its own CLI. AFAIK cookiecutters don't allow for arbitrary scripts to be run in response to inputs, so copying files from a contents folder into the project can't be accomplished by cookiecutters alone. You can get creative and inject paths into a python or bash script in the template and run that script as apart of setup.py or something. I'm glad that you arrived at a similar conclusion for completely different reasons! 👍 |
this is now done with the CLI! |
Currently, the instructions for Jupyter Book require somebody to copy the git repository or fork it. However, this causes a fair bit of confusion and may be problematic if people want to make multiple books.
Another option would be to define jupyter-book as a cookiecutter package that people can quickly populate with their project-specific info. I'm thinking something like:
content/
folder.This way, you should be able to get up-and-running with jupyter-book more easily, and it might making upgrading easier in the future.
Design spec
From the user's perspective
A CLI is used to manage the creation of new Jupyter Books. Something like
Jupyter-book will then use the cookiecutter python moule to create a new jupyter book project from the template. It will do the following:
config.yaml
and asking questions for the remaining fields using cookiecutter--content
is provided, copy the notebooks in--content
to thecontent/
folder of the resulting repository--toc
is provided, copy the file to the_data/toc.yml
file. If--content
is provided but not--toc
is provided, auto-populate a TOC using alphanumeric ordering of the content folder to help people get started.In this way, users could upgrade to a new version of jupyter book by keeping their book's configuration file separate along w/ the TOC and then running
The result should be a fully-functioning book that can be run with
make book
, w/ the latest CSS/JS/etc in the jupyter-book repository.I know that @arokem likes cookiecutters. Do you think this sounds reasonable? I saw that @gnestor was also commenting in the cookiecutter repo, any chance you have thoughts? :-)
The text was updated successfully, but these errors were encountered: