gw-ospo / jupyter-book-template

https://gw-ospo.github.io/jupyter-book-template/
Creative Commons Attribution 4.0 International
1 stars 0 forks source link

should all the contents of `_build` be ignored by git? #1

Closed labarba closed 6 months ago

labarba commented 6 months ago

The .gitignore file has the following:

# ignore just the book PDF file!!
# https://stackoverflow.com/a/16318111/670433
example-book/_build/*
!example-book/_build/latex
example-book/_build/latex/*
!example-book/_build/latex/book.pdf

Why are the contents of the _build/latex folder (except for the PDF) being version controlled? The "true" source is always the authored content in Markdown files or Jupyter notebooks. A typical workflow for generating a PDF version of the book is a local build of the LaTeX file. I do not thing these files should be pushed to the repository.

labarba commented 6 months ago

Also, the instructions in the README should tell the user that they need to manually edit the .gitignore file with their chosen folder name for the built Jupyter Book. Users will want to change example-book to something that makes sense to them, so this probably needs to be changed in several places, and detailed instructions of where to edit this are needed.

labarba commented 6 months ago

And now I see that the PDF file is, in fact, contained in the repository at https://github.com/gw-ospo/jupyter-book-template/tree/main/example-book/_build/latex — It looks like I got it wrong, and the rule above is in fact including a version-controlled PDF file, while ignoring all the other LaTeX files. (I'm not familiar with these fancy ignore rules.)

A PDF file is a binary so it should not be version-controlled. So where does this idea come from to put it in the repo?

s2t2 commented 6 months ago

Here is a reference to the PDF file we can link to, as necessary, so we can remove the PDF from the repo and still be able to point to an example...

book.pdf