Create books from a template¶
Jupyter Book lets you quickly generate a book structure from templates. This section covers the process of creating a template book and building it as an alternative to manually creating the files in your book.
To see your options for creating books from templates, run the following command:
jupyter-book create --help
Usage: jupyter-book create [OPTIONS] PATH_BOOK Create a Jupyter Book template that you can customize. Options: --cookiecutter Use cookiecutter to interactively create a Jupyter Book template. -h, --help Show this message and exit.
Quickly generate a sample book¶
This option is best if you are starting from scratch, or would like to see one example of a simple Jupyter Book on your own filesystem.
If you’d just like to quickly create a sample book, you may do so by running the following command:
jupyter-book create mynewbook/
This will generate a mini Jupyter Book that you can both build and explore locally. It will have a few decisions made for you, and you can explore the configuration of the book in
_config.yml and its structure in
_toc.yml. Use this book as inspiration, or as a starting point to work from.
Generate a more complete book from interactive prompts¶
This option is best if you’d like to answer a few questions from the command line in order to create a template book that is more complex and customized for your use-case.
Jupyter Book also provides a Jupyter Book cookiecutter that can be used to interactively create a book directory structure.
The cookiecutter is suitable for users that want to create a ready-to-go repository to host their book that includes pre-populated metafiles such as
CONTRIBUTING, etc., as well as GitHub Actions workflow files to Automatically host your book with GitHub Actions.
To try the cookiecutter template, run the following command:
jupyter-book create mynewbook/ --cookiecutter
For more help, see the Jupyter Book cookiecutter GitHub repository, or run: