coursebook
coursebook copied to clipboard
Move All Chapters to a chapters subfolder
Is your feature request related to a problem? Please describe. There are a lot of folders in the top level. Since a lot of the folders share a category, we should subfolder them.
Describe the solution you'd like All chapters to be in their own subfolder
Describe alternatives you've considered NA
Additional context We'll need to change the scripts, travis, and all the tex files and the Makefile because
- Scripts have some hard coded glob patters
- Travis does some caching
- All the tex files do relative pathing from repo root and the inputs need to be sanitized as such
- Makefile is 100% based in patterns
One thing I've been thinking about is to have chapter specific makefiles that inherit macros/rules from a "template" makefile in the root directory. Then the "root" makefile will recursively enter all directories, run make, and then use a pdf sticher to combine pdfs or something. This allows for some chapters to have more complex build systems if they want it, or more importantly, it just has a more modular structure that's easier to understand/work with imo (e.g. I'm working on the filesystems chapter and want to preview just the filesystems pdf, I can just run make in the current directory rather than doing make -C .. filesystems/filesystems.tex
Another advantage is that all paths in the tex files can be relative to their current directory, which makes sense to me.
down side is that we have to write the "template" makefile which may involve macros, though I suspect it will actually be quite straightforward and easy to read.
If we are getting to that stage, I think cmake or writing a simple pythonic build system is the way to go overall.
This issue right now deals more with the fact that the folders at the top level have a naming scheme denoting chapters from non-chapters, which ideally that should be represented in the directory structure.
My cmake experiences for large projects is that it is useful when you want general portability across multiple platforms but, like autoconf, it comes at a significant cost (time + complexity + another tool to configure).
Using gnu make across multiple subdirs (and you can still keep some configuration stuff at the top level) is not hard. e.g. https://stackoverflow.com/questions/17834582/run-make-in-each-subdirectory