Skip to content
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

Add jupyter book version #104

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lhoupert
Copy link

@lhoupert lhoupert commented May 5, 2021

As promised in #95 , I am proposing a jupyter-book version of the book. To generate the jupyter-book, I added a _config.yml and _toc.yml files. Then it is relatively straightforward to build the book.

Essentially:

  1. Install the most up to date version of jupyter-book:
pip install git+https://github.com/executablebooks/jupyter-book
  1. Go to the root directory of the repository and run:
jupyter-book build . --path-output jupyter-book/.
  1. Open Jupyter-book at jupyter-book/_build/html/index.html

Pdf version of the jupyter-book

It is also possible to use jupyter-book to generate a pdf version of the book, which could interest #99 . To do that you need to:

  1. Install pyppeteer

  2. Go to the root directory of the repository and run:

jupyter-book build . --builder pdfhtml --path-output jupyter-book/.   
  1. Open jupyter-book/_build/pdf/book.pdf

@lhoupert
Copy link
Author

lhoupert commented May 5, 2021

Deploying the book as an html website, is also relatively straightforward. I tested it on my website.

I first, created a new repository, then I copy the content of the _build/html directory and then I use the ghp-import package following instructions on the jupyter-book website (https://jupyterbook.org/start/publish.html).

The test repository I created can be seen here: https://github.com/lhoupert/test-jbook and the book can be seen online here: https://lhoupert.fr/test-jbook/book.html

@lhoupert lhoupert mentioned this pull request May 5, 2021
@rougier
Copy link
Owner

rougier commented May 15, 2021

Impressive! Many thanks. Maybe you can add your name in the preface with a new section About the Jupyer notebook and explaining you did the conversion for notebook and PDF.

Currently, the HTML displays some glitches (probably because of fonts) and movies are not rendered. Any idea?

Should I merge now and you'll open a new PR if needed or do you prefer I wait?

@lhoupert
Copy link
Author

Hello @rougier , yes good idea. I will do that later this week and also try to see why the movies are not rendered. Do you have any example of glitches ?

@rougier
Copy link
Owner

rougier commented May 19, 2021

In factn the only "glitch" is mostly the front page at https://lhoupert.fr/test-jbook/book.html. The copyright notice is too big compared to the title. By the way, you could also add your name/copyright on the front page for the ebook/jupyter conversion.

@lhoupert
Copy link
Author

I fixed the gliches :-)
For the video, I just copied again the data folder into the folder with the html/ build. I think the relative links were not recognized when inserting raw html block in the rst files?

Anyway I think it is good practice to have a self-contained html folder : it is easier to publish it using Github Pages tools.

A test version can be seen here: https://lhoupert.fr/test-jbook

@lhoupert
Copy link
Author

@rougier if you want you could create a repository (e.g. from-python-to-numpy-jupyterbook? ) where you copied only the HTML folder from https://github.com/lhoupert/from-python-to-numpy/tree/add-jupyter-book-version/jupyter-book

If you follow the steps indicated here, you should be able to publish it on a custom domain name.

There is certainly a way to integrate this directly to this repository (from-python-to-numpy) using github CI/CD tools but I am less familiar with it.

Let me know what you think is the best. I am also happy to host it on my website, for example at lhoupert.fr/from-python-to-numpy-jupyter-book/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants