Comments (10)
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).
from jupyter-book.
see #89
from jupyter-book.
@gnestor well I think we are one step ahead of you :-) there's a PR that implements a jupyter-book CLI here: #89 would love to hear what you think about it!
from jupyter-book.
this is now done with the CLI!
from jupyter-book.
cc @yuvipanda who I think has a good eye for user-interface design! do you have any thoughts on the above?
from jupyter-book.
hmmm, I'm a bit worried that cookiecutter won't work here, this is primarily because cookiecutter uses liquid templates, which also use the {{
convention used throughout this site. This means that we'd have to wrap all of our {{
in raw
tags, or double-escape them ({{ {{ site.xxx }} }}
), see cookiecutter/cookiecutter#9
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 option
Keep the book in a template-like form but a bit more light-weight than what cookiecutter uses. Split out the jupyter-book
repo into two folders:
book_template/
would have a template book repository very similar to what is here now.cli/
would have a little python package that controls jupyter-book.
You'd create a new jupyter book using a pattern like:
jupyter-book create
--name mybook # The name of the book to be created (also the output folder)
[--version v0.1] # Specifies a version of jupyter-book
[--config myconfig.yaml] # Pre-fill these configuration options
[--content path/to/content/folder] # Folder w/ Jupyter Notebooks + markdown files
[--toc path/to/toc.yml] # With URLs relative to the content folder
[--css path/to/custom.css] # Custom CSS rules to add to the site
[--js path/to/script.js] # Custom JS scripts to add to the site
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 _config.yaml
in the book_template/
folder. In this way there wouldn't be any live user-input, it'd only be a question of updating whatever fields are there.
from jupyter-book.
@choldgraf said this to me in person yesterday and I like it!
from jupyter-book.
from jupyter-book.
cool, will prototype something soon!
from jupyter-book.
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! 👍
from jupyter-book.
Related Issues (20)
- Upload to PyPI failed for 1.0.1 HOT 10
- Theme error HOT 1
- Jupylerbook HOT 1
- top left hamburger button not working HOT 6
- glitch in the docs for jb1, in the section on folium
- Grids of cards not rendering HOT 2
- Issue on page /Module-D7/torque.html
- Allow customization of dropdown button text for hidden content
- git-course-exercise-1 HOT 1
- Marginal Notes do not render correctly in PDF
- option "use_repository_button" does not display button to repository
- Update dependencies to allow myst-parser v3
- Plausible analytics config not working as expected HOT 4
- Warn users about PDF builds changing the non-PDF HTML build
- README - outdated section? HOT 2
- Poor visibility of "Show code cell source/output" text in dark mode
- Issue on page /摩阻扭矩-井轨迹计算.html
- Configure theme (e.g. primary color?)
- Jupyter book stripping path from produced html output HOT 1
- Exclude book notebooks from execution does not seem to work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyter-book.