Skip to content

Commit

Permalink
Merge pull request #35 from d120/refactor/kotlin
Browse files Browse the repository at this point in the history
Update slides from Python to Kotlin
  • Loading branch information
Oshgnacknak authored Oct 2, 2023
2 parents 10f80d9 + 1bdc439 commit de76b05
Show file tree
Hide file tree
Showing 116 changed files with 2,242 additions and 1,632 deletions.
94 changes: 94 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"name": "latex",
"image": "ghcr.io/tudalgo/algotex:latest",
"customizations": {
"vscode": {
"extensions": [
"james-yu.latex-workshop",
// Git
"eamodio.gitlens",
// Other helpers
"shardulm94.trailing-spaces",
"stkb.rewrap", // rewrap comments after n characters on one line
// Other
"vscode-icons-team.vscode-icons",
"draivin.hsnips"
],
"settings": {
// General settings
"files.eol": "\n",
// Latex settings
"latex-workshop.linting.chktex.enabled": true,
"latex-workshop.linting.chktex.exec.path": "chktex",
"latex-workshop.latex.clean.subfolder.enabled": true,
"latex-workshop.latex.autoClean.run": "onBuilt",
"editor.formatOnSave": true,
"files.associations": {
"*.tex": "latex",
"*.sty": "latex-expl3",
"*.cls": "latex-expl3",
"*.def": "latex",
"*.aux": "latex",
"*.toc": "latex",
"*.pygstyle": "latex",
"*.pygtex": "latex"
},
"latex-workshop.latexindent.path": "latexindent",
"latex-workshop.latexindent.args": [
"-c",
"%DIR%/",
"%TMPFILE%",
"-y=defaultIndent: '%INDENT%'"
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"--shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-lualatex",
//"-pdflatex",
"-outdir=%OUTDIR%",
"%DOC%"
],
"env": {
//"DARK_MODE": "1"
}
},
{
"name": "pdflatex",
"command": "pdflatex",
"args": [
"--shell-escape",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
},
{
"name": "lualatex",
"command": "lualatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"-luatex",
"%DOC%"
]
},
{
"name": "bibtex",
"command": "bibtex",
"args": [
"%DOCFILE%"
]
}
],
}
}
}
}
42 changes: 36 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: Build

# Controls when the workflow will run
Expand Down Expand Up @@ -39,15 +37,19 @@ jobs:
# 3. Build the documents
- name: "Build the documents"
run: |
make -j $(nproc) -C lecture
mv lecture/pdfout pdfout
make -j -C lecture compile
make -j -C exercises compile
make -j -C misc/linux_commands compile
mkdir -p pdfout
cp lecture/pdfout/*.pdf pdfout/
cp exercises/pdfout/*.pdf pdfout/
cp misc/linux_commands/pdfout/*.pdf pdfout/
# 4. Upload artifacts to GitHub
- name: Upload artifacts to GitHub
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v3
with:
name: Vorkurs-Folien
name: Vorkurs-Materialien
path: "pdfout/*.pdf"
if-no-files-found: error

Expand All @@ -69,3 +71,31 @@ jobs:
# fail_on_unmatched_files: true
# draft: false
# prerelease: false

deploy:
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch'|| github.event_name == 'pull_request' }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: build_latex
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_SECRET_KEY }}
known_hosts: "just-a-placeholder-so-we-dont-get-errors"

- name: Adding Known Hosts
run: |
mkdir -p ~/.ssh
ssh-keyscan -H login.d120.de > ~/.ssh/known_hosts
# save the pdf file from the previous workflow
- name: Save pdf file
uses: actions/download-artifact@v3
with:
path: .
name: Vorkurs-Materialien

- name: Deploy with rsync
run: rsync -avz * ${{ secrets.SSH_USER }}@login.d120.de:public_html
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

OUT_DIR := pdfout/
# find all makefiles in subdirectories
MAKEFILES := $(shell find . -mindepth 2 -name 'Makefile' -not -path './.git/*' -not -path './.devcontainer')

$(MAKEFILES:Makefile=Makefile.all):
$(eval MAKEFILE := $(patsubst %.all,%,$@))
@$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) all
@mkdir -p $(OUT_DIR)
@cp $(dir $(MAKEFILE))/$(OUT_DIR)/*.pdf $(OUT_DIR)

$(MAKEFILES:Makefile=Makefile.compile):
$(eval MAKEFILE := $(patsubst %.compile,%,$@))
$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) compile
@mkdir -p $(OUT_DIR)
@cp $(dir $(MAKEFILE))/$(OUT_DIR)/*.pdf $(OUT_DIR)

$(MAKEFILES:Makefile=Makefile.clean):
$(eval MAKEFILE := $(patsubst %.clean,%,$@))
$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) clean

# $(MAKEFILES:Makefile=Makefile.cleanBuild):
# $(eval MAKEFILE := $(patsubst %.cleanBuild,%,$@))
# @$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) cleanBuild

$(MAKEFILES:Makefile=Makefile.cleanAll):
$(eval MAKEFILE := $(patsubst %.cleanAll,%,$@))
@$(MAKE) -C $(dir $(MAKEFILE)) -f $(notdir $(MAKEFILE)) cleanAll

all: $(MAKEFILES:Makefile=Makefile.all)
@echo -e "\e[1;42mAll Done. PDFs can be found in $(OUT_DIR)\e[0m"

compile: $(MAKEFILES:Makefile=Makefile.compile)
@echo -e "\e[1;42mAll Done. PDFs can be found in $(OUT_DIR)\e[0m"

clean: $(MAKEFILES:Makefile=Makefile.clean)
@echo -e "\e[1;44mCleaned up all subdirectories.\e[0m"

cleanBuild:
@echo -e "\e[1;34mCleaning up build directory...$<\e[0m"
@rm -rf $(OUT_DIR)
@echo -e "\e[1;44mDone cleaning up build directory.$<\e[0m"

cleanAll: $(MAKEFILES:Makefile=Makefile.cleanAll) cleanBuild
@echo -e "\e[1;44mCleaned up all subdirectories + build dirs.\e[0m"
4 changes: 2 additions & 2 deletions codingchallenges/2019/aufgabenstellung.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\documentclass[accentcolor=3c,colorbacktitle,12pt]{tudaexercise}
\RequirePackage{import}
\subimport{../../exercises}{preamble.tex}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
Expand All @@ -8,7 +9,6 @@
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{multirow}
\input{../../shared/globalCommon}

\setlength{\parindent}{0pt}

Expand Down
4 changes: 2 additions & 2 deletions codingchallenges/2021/aufgabenstellung.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\documentclass[ngerman,accentcolor=3c,colorbacktitle,12pt,T1]{tudaexercise}
\RequirePackage{import}
\subimport{../../exercises}{preamble.tex}

% Packages
\usepackage{hyperref}
Expand All @@ -8,7 +9,6 @@
\usepackage{tikz}
\usetikzlibrary{fit,backgrounds}

\input{../../shared/globalCommon}

\usepackage[font=normalsize, labelfont=sf, position=bottom]{caption}
\usepackage[labelfont=normalfont, position=bottom]{subcaption}
Expand Down
4 changes: 2 additions & 2 deletions codingchallenges/2022/aufgabenstellung.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\documentclass[ngerman,accentcolor=3c,colorbacktitle,12pt]{tudaexercise}
\RequirePackage{import}
\subimport{../../exercises}{preamble.tex}

% Packages
\usepackage{hyperref}
Expand All @@ -9,7 +10,6 @@
\usepackage{tikz}
\usetikzlibrary{fit,backgrounds}

\input{../../shared/globalCommon}

\usepackage[font=normalsize, labelfont=sf, position=bottom]{caption}
\usepackage[labelfont=normalfont, position=bottom]{subcaption}
Expand Down
Loading

0 comments on commit de76b05

Please sign in to comment.