Skip to content

Commit c10ac36

Browse files
committed
add Dockerfile to generate pdfs
1 parent fb07273 commit c10ac36

File tree

77 files changed

+65
-33
lines changed

Some content is hidden

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

77 files changed

+65
-33
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.12-slim
2+
3+
RUN apt update && apt upgrade -y \
4+
&& apt install -y \
5+
pandoc texlive texlive-xetex\
6+
&& apt clean \
7+
&& /bin/rm -rf /var/lib/apt/lists/*
8+
9+
RUN pip install --upgrade pip
10+
11+
COPY requirements.txt ./
12+
RUN pip install --no-cache-dir -r requirements.txt
13+
14+
ENTRYPOINT ["/bin/bash","-i","-c","\"$@\"","--"]

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
container:
3+
build:
4+
context: ./ # Use the current directory as the build context
5+
dockerfile: Dockerfile
6+
working_dir: /root
7+
volumes:
8+
- ./:/root/
9+
command: ["sh", "-c", "bash generatepdfs.sh"]

generatepdfs.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
# Script to convert jupyter notebooks to PDF files. The pdfs are saved in ./pdfs folder
44

5-
sudo apt update
6-
sudo apt install -y pandoc texlive texlive-xetex > /dev/null
7-
85
files=$(find . -name '*.ipynb')
96
for f in $files; do
107
echo Converting: $f

notebooks/Ch01-Introduction.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"# Introduction\n",
8-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch01-Introduction.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
8+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch01-Introduction.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
99
"\n",
1010
"- HTML version of textbook: [http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html](http://openbookproject.net/thinkcs/python/english3e/way_of_the_program.html)\n",
1111
"- PDF version of textbook: [http://www.greenteapress.com/thinkpython/thinkCSpy/thinkCSpy.pdf](http://www.greenteapress.com/thinkpython/thinkCSpy/thinkCSpy.pdf)\n",

notebooks/Ch02-1-Data-Variables-StdIO.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Data, Values, Expressions, Statements and Std IO\n",
88
"\n",
9-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch02-Data-Variables.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
9+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch02-Data-Variables.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
1010
"\n",
1111
"\n",
1212
"- http://openbookproject.net/thinkcs/python/english3e/variables_expressions_statements.html\n",

notebooks/Ch02-2-BitwiseOperators.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# 2. Bitwise Operators\n",
88
"\n",
9-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch02-1-BitwiseOperators.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
9+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch02-1-BitwiseOperators.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
1010
"\n",
1111
"- https://wiki.python.org/moin/BitwiseOperators\n",
1212
"\n",

notebooks/Ch03-1-Functions-Built-in.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"## Built-in Functions\n",
8-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch03-1-Functions-Built-in.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
8+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch03-1-Functions-Built-in.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
99
"\n",
1010
"- named sequence of code that does some specific task or a function\n",
1111
"- we'll learn how to define our own functions in [User Defined Functions chapter](./Ch03-3-Functions-UserDefined.ipynb)\n",

notebooks/Ch03-2-Functions-Library.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"source": [
77
"# Python Standard Libraries\n",
88
"\n",
9-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch03-2-Functions-Library.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
9+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch03-2-Functions-Library.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
1010
"\n",
1111
"## Topics\n",
1212
"- Python standard libraries\n",

notebooks/Ch03-3-Functions-UserDefined.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"# User-defined Functions\n",
8-
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/Ch03-3-Functions-UserDefined.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
8+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch03-3-Functions-UserDefined.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
99
"- http://openbookproject.net/thinkcs/python/english3e/functions.html\n",
1010
"\n",
1111
"## Topics\n",

notebooks/Ch03-4-UnittestingFunctions.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"source": [
77
"# Unit testing Code\n",
88
"\n",
9+
"<a href=\"https://colab.research.google.com/github/rambasnet/FDSPython-Notebooks/blob/master/notebooks/Ch03-4-UnittestingFunctions.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n",
910
"\n",
1011
"## Topics\n",
1112
"\n",

0 commit comments

Comments
 (0)