Skip to content

Commit 13f2b5b

Browse files
committed
move to centralized bookbase building process
1 parent 2bb7840 commit 13f2b5b

File tree

146 files changed

+57
-5567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+57
-5567
lines changed

.github/workflows/build.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: publish
22

33
on:
4-
push:
4+
push:
55
branches:
66
- main
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v4.2.2
13+
with:
14+
submodules: true
1315
- uses: xu-cheng/texlive-action@d9f893f837a29f066e3c70080540976b47263721
1416
with:
1517
scheme: full

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "bookbase"]
2+
path = bookbase
3+
url = https://github.com/thomasWeise/bookbase

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ This version may change since this course and book both are work in progress.
4444
You can freely share this.
4545
You can also copy text or figures under the license given below, as long as you cite the book as the original source, e.g., by using the following BibTeX:
4646

47-
<pre>@book{programmingWithPython,<br/>&nbsp;author&nbsp;=&nbsp;{<a href="http://iao.hfuu.edu.cn/5">Thomas&nbsp;Weise</a>},<br/>&nbsp;title&nbsp;=&nbsp;{Programming&nbsp;with&nbsp;Python},<br/>&nbsp;year&nbsp;=&nbsp;{2024},<br/>&nbsp;publisher&nbsp;=&nbsp;{<a href="http://iao.hfuu.edu.cn">Institute&nbsp;of&nbsp;Applied&nbsp;Optimization</a>,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.hfuu.edu.cn/aibd">School&nbsp;of&nbsp;Artificial&nbsp;Intelligence&nbsp;and&nbsp;Big&nbsp;Data</a>,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.hfuu.edu.cn/">Hefei&nbsp;University</a>},<br/>&nbsp;address&nbsp;=&nbsp;{Hefei,&nbsp;Anhui,&nbsp;China},<br/>&nbsp;url&nbsp;=&nbsp;{<a href="https://thomasweise.github.io/programmingWithPython">https://thomasweise.github.io/programmingWithPython</a>}<br/>}</pre>
47+
<pre>@book{programmingWithPython,<br/>&nbsp;author&nbsp;=&nbsp;{<a href="http://iao.hfuu.edu.cn/5">Thomas&nbsp;Weise</a>},<br/>&nbsp;title&nbsp;=&nbsp;{Programming&nbsp;with&nbsp;Python},<br/>&nbsp;year&nbsp;=&nbsp;{2024--2025},<br/>&nbsp;publisher&nbsp;=&nbsp;{<a href="http://iao.hfuu.edu.cn">Institute&nbsp;of&nbsp;Applied&nbsp;Optimization</a>,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.hfuu.edu.cn/aibd">School&nbsp;of&nbsp;Artificial&nbsp;Intelligence&nbsp;and&nbsp;Big&nbsp;Data</a>,<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.hfuu.edu.cn/">Hefei&nbsp;University</a>},<br/>&nbsp;address&nbsp;=&nbsp;{Hefei,&nbsp;Anhui,&nbsp;China},<br/>&nbsp;url&nbsp;=&nbsp;{<a href="https://thomasweise.github.io/programmingWithPython">https://thomasweise.github.io/programmingWithPython</a>}<br/>}</pre>
4848

4949
**If you have any comments or suggestions regarding the book, or if you spotted an error or typo, please feel free to submit an [issue here](https://github.com/thomasWeise/programmingWithPython/issues).**
5050
Your feedback would help us to improve the book.

bookbase

Submodule bookbase added at 613fc22

make.sh

+1-75
Original file line numberDiff line numberDiff line change
@@ -8,78 +8,4 @@ set -o errtrace # trace ERR through 'time command' and other functions
88
set -o nounset # set -u : exit the script if you try to use an uninitialized variable
99
set -o errexit # set -e : exit the script if any statement returns a non-true return value
1010

11-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Welcome to the book building script."
12-
13-
currentDir="$(pwd)"
14-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We are working in directory: '$currentDir'."
15-
scriptDir="$currentDir/shared/scripts"
16-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): The script directory is '$scriptDir'."
17-
18-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We delete all left over data."
19-
websiteDir="$currentDir/website"
20-
rm -rf "$websiteDir" || true
21-
mkdir -p "$websiteDir"
22-
23-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We setup a virtual environment in a temp directory."
24-
venvDir="$(mktemp -d)"
25-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Got temp dir '$venvDir', now creating environment in it."
26-
python3 -m venv --upgrade-deps --copies "$venvDir"
27-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Activating virtual environment in '$venvDir'."
28-
source "$venvDir/bin/activate"
29-
export PYTHON_INTERPRETER="$venvDir/bin/python3"
30-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Setting python interpreter to '$PYTHON_INTERPRETER'."
31-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We install all required Python packages from requirements.txt to virtual environment in '$venvDir'."
32-
"$PYTHON_INTERPRETER" -m pip install --no-input --timeout 360 --retries 100 -r requirements.txt
33-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Finished installing the requirements, now printing all installed packages."
34-
pip freeze
35-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Finished printing all installed packages."
36-
37-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We now build the slides."
38-
39-
slidesDir="$currentDir/slides"
40-
lastLatexGit=""
41-
for dirName in "$slidesDir/"*; do
42-
dirName="$(basename "$dirName")"
43-
theDir="$slidesDir/$dirName"
44-
if [ -d "$theDir" ]; then
45-
docName="$dirName.tex"
46-
if [ -f "$theDir/$docName" ]; then
47-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Found directory '$theDir' with document '$docName'."
48-
49-
curDirGit="$theDir/__git__"
50-
rm -rf "$curDirGit"
51-
if [ -n "$lastLatexGit" ]; then
52-
mv "$lastLatexGit" "$theDir"
53-
lastLatexGit=""
54-
fi
55-
56-
cd "$theDir"
57-
"$scriptDir/pdflatex.sh" "$docName"
58-
"$scriptDir/pdfsizeopt.sh" "$dirName.pdf" "$websiteDir/$dirName.pdf"
59-
rm "$dirName.pdf"
60-
61-
if [ -d "$curDirGit" ]; then
62-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Git directory is $curDirGit."
63-
lastLatexGit="$(realpath "$curDirGit")"
64-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Canonicalized git directory is $lastLatexGit."
65-
fi
66-
cd "$currentDir"
67-
else
68-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Found directory '$theDir', but it does not contain a corresponding LaTeX document."
69-
fi
70-
fi
71-
done
72-
73-
if [ -d "$lastLatexGit" ]; then
74-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Cleaning up '$lastLatexGit'."
75-
rm -rf "$lastLatexGit"
76-
fi
77-
78-
"$scriptDir/website.sh" "$websiteDir"
79-
80-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Deactivating virtual environment."
81-
deactivate
82-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): Deleting virtual environment."
83-
rm -rf "$venvDir"
84-
85-
echo "$(date +'%0Y-%0m-%0d %0R:%0S'): We have finished the slides building process."
11+
./bookbase/scripts/slidesMake.sh "Programming with Python" "https://thomasweise.github.io/programmingWithPythonSlides"

requirements.txt

-18
This file was deleted.

0 commit comments

Comments
 (0)