Compare commits

..

10 Commits

Author SHA1 Message Date
alexander
6dfe3998e1 a
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 10s
2026-01-19 01:08:41 +01:00
alexander
421ddd1f6d aaaa
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 10s
2026-01-19 01:06:07 +01:00
alexander
ecdc00b4b2 moved more around
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 11s
2026-01-19 01:04:12 +01:00
alexander
8b24c9ea8e a
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 9s
2026-01-19 00:58:42 +01:00
alexander
740384a433 Moved names arround
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 9s
2026-01-19 00:57:27 +01:00
alexander
0f9aed8b07 ci/Cd
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 10s
2026-01-19 00:54:41 +01:00
alexander
d8769ca440 Update gitea
Some checks failed
Build Typst PDFs (Docker) / build-typst (push) Failing after 12s
2026-01-19 00:52:40 +01:00
alexander
6cdd323198 removed old shit
Some checks failed
Build Typst PDFs (Docker) / build-typst (push) Failing after 16s
2026-01-19 00:39:42 +01:00
alexander
d3c51d5ee7 Merge branch 'clean' 2026-01-19 00:38:41 +01:00
alexander
ae64e72fd4 reverted to old state 2026-01-19 00:38:18 +01:00
26 changed files with 4155 additions and 20739 deletions

View File

@@ -7,16 +7,13 @@ on:
pull_request: pull_request:
branches: [ "**" ] branches: [ "**" ]
env:
TYPST_SOURCE_DIR: src
BUILD_DIR: build
jobs: jobs:
build-typst: build-typst:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Run the whole job inside a Docker container that has Typst installed # Run the whole job inside a Docker container that has Typst installed
steps: steps:
- uses: typst-community/setup-typst@v4
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
@@ -27,38 +24,25 @@ jobs:
- name: Debug Ls - name: Debug Ls
run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}" run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}"
- name: Build Typst builder image - name: Make build directory
uses: docker/build-push-action@v2 run: mkdir -p build
with:
tags: typst-builder-image:latest
push: false
- name: Compile all .typ files - name: Compile Analysis1
uses: addnab/docker-run-action@v3 continue-on-error: true
env: run: typst compile --root src src/cheatsheets/Analysis1.typ build/Analysis1.pdf
TYPST_SOURCE_DIR: ${{ env.TYPST_SOURCE_DIR }}
BUILD_DIR: ${{ env.BUILD_DIR }}
with:
image: typst-builder-image:latest
options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
cwd: ${{ github.workspace }}
run: "cd ${{ github.workspace }} && TYPST_SOURCE_DIR=${{ env.TYPST_SOURCE_DIR }} BUILD_DIR=${{ env.BUILD_DIR }} bash -c ./compile-all.bash"
- name: Upload PDFs - name: Compile Schaltungstheorie
if: always() continue-on-error: true
uses: actions/upload-artifact@v3 run: typst compile --root src src/cheatsheets/Schaltungstheorie.typ build/Schaltungstheorie.pdf
with:
name: typst-pdfs - name: Compile LinAlg
path: ${{ env.BUILD_DIR }}/*.pdf continue-on-error: true
if-no-files-found: warn run: typst compile --root src src/cheatsheets/LinearAlgebra.typ build/LinearAlgebra.pdf
- name: Create Gitea Release - name: Create Gitea Release
uses: softprops/action-gh-release@v1 continue-on-error: true
uses: akkuman/gitea-release-action@v1
with: with:
tag_name: ${{ steps.tag.outputs.tag }} name: "Formelsammlungen PDFs"
name: Typst PDFs ${{ steps.tag.outputs.tag }} tag_name: "latest"
body: | files: build/*.pdf
Automated release of Typst-generated PDFs.
Commit: ${{ github.sha }}
files: ${{ env.BUILD_DIR }}/*.pdf

View File

@@ -1,3 +0,0 @@
{
}

45
.vscode/tasks.json vendored
View File

@@ -1,45 +0,0 @@
{
"tasks": [
{
"label": "Run build Script",
"type": "shell",
"command": "${workspaceFolder}/.venv/bin/python",
"args": ["src/build.py"],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Watch Styles",
"type": "shell",
"command": "sass",
"args": ["--watch", "styles:static/css"],
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": "^.*$",
"file": 1,
"location": 2,
"message": 3
},
"background": {
"activeOnStart": true,
"beginsPattern": "^.*Watching.*$",
"endsPattern": "^.*Watching.*$"
}
}
},
{
"label": "Run debug server",
"type": "shell",
"command": "${workspaceFolder}/.venv/bin/python",
"args": ["src/debug_server.py"],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@@ -1,12 +0,0 @@
:8000 {
root * /www
basic_auth /* bcrypt {
# fsei, fsei
fsei $2a$10$LfHwTJ70tvvYL7q5wved2e6DgRrB5xpDXM2SM9tryazKwSEq6/wFC
123 $2a$10$qg47SkDZvTz6C8/jh2GVY.blpIfzIUVUAyF.inAa3AD/zb7KecD8G
ei $2a$10$RKMEtHT7hHFGhl1gSfx4Se9K.YyEQ0nvM/DxoOvpg/XdhULTANcoq
}
file_server
}

View File

@@ -1,14 +0,0 @@
FROM python:3.11 AS build
WORKDIR /workdir
COPY . .
RUN pip install --no-cache-dir -r ./requirements.txt
RUN python3 src/build.py
FROM caddy:latest AS serve
COPY --from=build /workdir/out/ /www/
COPY --from=build /workdir/Caddyfile /etc/caddy/Caddyfile
RUN caddy validate --config /etc/caddy/Caddyfile

4135
build/Analysis1.pdf Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,59 +0,0 @@
{
"items": [
{
"url": "https://github.com/user/python-cheatsheet",
"cache": true,
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Python Basics Cheatsheet",
"author": "John Doe",
"git_commit": "abc123def456",
"git_repo": "https://github.com/user/python-cheatsheet",
"git_repo_type": "github",
"date": "2025-01-15"
},
{
"url": "https://example.com/js-guide.pdf",
"cache": false,
"id": "550e8400-e29b-41d4-a716-446655440001",
"title": "JavaScript Quick Reference",
"author": null,
"git_commit": null,
"git_repo": null,
"git_repo_type": "external",
"date": "2025-01-10"
},
{
"url": "https://gitlab.com/team/react-patterns",
"cache": true,
"id": "550e8400-e29b-41d4-a716-446655440002",
"title": "React Design Patterns",
"author": "Jane Smith",
"git_commit": "xyz789abc",
"git_repo": "https://gitlab.com/team/react-patterns",
"git_repo_type": "gitlab",
"date": "2025-01-08"
},
{
"url": "https://raw.githubusercontent.com/latex4ei/Computertechnik/gh-pages/Computertechnik.pdf",
"cache": false,
"id": "550e8400-e29b-41d4-a716-446655440003",
"title": "CSS Tips & Tricks",
"author": "Alex Johnson",
"git_commit": null,
"git_repo": "https://github.com/awesome/css-tips",
"git_repo_type": "github",
"date": "2024-12-20"
},
{
"url": "https://raw.githubusercontent.com/latex4ei/Computertechnik/gh-pages/Computertechnik.pdf",
"cache": true,
"id": "550e8400-e29b-41d4-a716-446655440004",
"title": "Docker & Kubernetes Guide",
"author": null,
"git_commit": "dev-2025-01-18",
"git_repo": "https://gitea.company.com/internal/devops",
"git_repo_type": "gitea",
"date": "2025-01-18"
}
]
}

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
SRC_DIR="${TYPST_SOURCE_DIR}"
OUT_DIR="${BUILD_DIR}"
if [[ ! -d "$SRC_DIR" ]]; then
echo "Source directory '$SRC_DIR' does not exist."
exit 1
fi
mkdir -p "$OUT_DIR"
# Find all .typ files under $SRC_DIR (excluding hidden dirs)
mapfile -d '' files < <(printf '%s\0' "$SRC_DIR"/*.typ 2>/dev/null)
if [[ ${#files[@]} -eq 0 ]]; then
echo "No .typ files found in '$SRC_DIR'."
exit 0
fi
for f in "${files[@]}"; do
# Trim leading ./ if present
rel="${f#./}"
# Destination path: build/<same-subdirs>/<filename>.pdf
dest_pdf="${OUT_DIR}/$(basename "${rel%.typ}").pdf"
echo "Compiling: $f -> $dest_pdf"
typst compile "$f" "$dest_pdf"
done

View File

@@ -1,6 +0,0 @@
services:
server_html:
build: .
ports:
- "8000:8000"

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,20 +0,0 @@
annotated-types==0.7.0
blinker==1.9.0
certifi==2026.1.4
charset-normalizer==3.4.4
click==8.3.1
Flask==3.1.2
idna==3.11
itsdangerous==2.2.0
Jinja2==3.1.6
libsass==0.23.0
livereload==2.7.1
MarkupSafe==3.0.3
pydantic==2.12.5
pydantic_core==2.41.5
requests==2.32.5
tornado==6.5.4
typing-inspection==0.4.2
typing_extensions==4.15.0
urllib3==2.6.3
Werkzeug==3.1.5

File diff suppressed because one or more lines are too long

View File

@@ -1,54 +0,0 @@
from jinja2 import Environment, FileSystemLoader, select_autoescape
from inventory import load_cheatsheet_inventory, download_cheatsheet, CheatsheetItem
import shutil
import datetime
INVENTORY_FILE = "cheatsheet_inventory.json"
STATIC_DIR = "static"
TEMPLATES_DIR = "templates"
OUTPUT_DIR = "out"
inv_raw = load_cheatsheet_inventory(INVENTORY_FILE)
inv: list[CheatsheetItem] = []
# Clear output directory
shutil.rmtree(OUTPUT_DIR, ignore_errors=True)
shutil.copytree(STATIC_DIR, OUTPUT_DIR)
for i in inv_raw.items:
a = None
if i.cache:
print("Downloading", i.url)
url = download_cheatsheet(i, OUTPUT_DIR)
if url is not None:
i.url = url
a = i
else:
a = i
if a is not None:
inv.append(a)
env = Environment(
loader=FileSystemLoader(TEMPLATES_DIR),
autoescape=select_autoescape()
)
index = env.get_template("index.html.j2")
for i in inv:
print("-", i)
thisYear = datetime.datetime.now().year
with open(f"{OUTPUT_DIR}/index.html", "w", encoding="utf-8") as f:
f.write(index.render(items=inv, thisYear=thisYear))
with open(f"{OUTPUT_DIR}/impressum.html", "w", encoding="utf-8") as f:
f.write(env.get_template("impressum.html.j2").render(thisYear=thisYear))
with open(f"{OUTPUT_DIR}/license.html", "w", encoding="utf-8") as f:
f.write(env.get_template("license.html.j2").render(thisYear=thisYear))

View File

@@ -1,7 +1,7 @@
#import "@preview/biceps:0.0.1" : * #import "@preview/biceps:0.0.1" : *
#import "@preview/mannot:0.3.1" #import "@preview/mannot:0.3.1"
#import "lib/styles.typ" : * #import "../lib/styles.typ" : *
#import "lib/common_rewrite.typ" : * #import "../lib/common_rewrite.typ" : *
#set page( #set page(
paper: "a4", paper: "a4",

View File

@@ -1,58 +0,0 @@
from pydantic import BaseModel, Field
from uuid import uuid4
import os
import hashlib
import requests
class CheatsheetItem(BaseModel):
url: str
cache: bool
id: str = Field(default_factory=lambda: uuid4().__str__())
title: str
author: str | None
git_commit: str | None
git_repo: str | None
git_repo_type: str
date: str
class CheatSheetExternalInfo(BaseModel):
tilte: str
author: str | None
class CheatsheetInvertoryConfig(BaseModel):
items: list[CheatsheetItem]
def load_cheatsheet_inventory(file: str) -> CheatsheetInvertoryConfig:
if not os.path.exists(file):
res = CheatsheetInvertoryConfig(items=[])
else:
res = CheatsheetInvertoryConfig.model_validate_json(
open(file, "r", encoding="utf-8").read()
)
with open(file, "w", encoding="utf-8") as f:
f.write(res.model_dump_json(indent=4))
return res
def download_cheatsheet(inv: CheatsheetItem, outdir: str) -> str | None:
r = requests.get(inv.url)
if not r.ok and r.headers.get("Content-Type") != "application/pdf":
return None
data = r.content
hashdata = hashlib.sha256(data)
filesname = os.path.join("cache", f"{hashdata.hexdigest()}.pdf")
if not os.path.exists(os.path.join(outdir, "cache")):
os.mkdir(os.path.join(outdir, "cache"))
with open(os.path.join(outdir, filesname), "wb") as f:
f.write(data)
print("Saved file to", filesname)
return filesname

View File

@@ -1,100 +0,0 @@
/*
* Styles for the Formelsammlung project
* 90's inspired aesthetic
*/
body {
background-color: #e8e8e8;
font-family: 'Trebuchet MS', Arial, sans-serif;
color: #333;
margin: 0;
padding: 0;
font-size: 14px;
padding-left: 20px;
padding-right: 20px;
width: calc(100vw - 40px);
}
/* Navbar styles */
nav.navbar {
background-color: #c0c0c0;
border-bottom: 2px solid #999;
padding: 15px 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
}
nav.navbar h3 {
margin: 0;
font-size: 18px;
color: #0051ba;
font-weight: bold;
}
nav.navbar a {
color: #0051ba;
text-decoration: none;
margin-left: 20px;
padding: 5px 10px;
border: 1px solid transparent;
transition: all 0.2s ease;
}
nav.navbar a:hover {
border: 1px solid #0051ba;
background-color: #dfdfdf;
}
/* Main content area padding */
body > h1,
body > table {
margin-left: 20px;
margin-right: 20px;
}
h1 {
color: #0051ba;
text-align: center;
font-weight: bold;
border-bottom: 2px solid #0051ba;
padding-bottom: 10px;
}
table {
width: calc(100% - 40px);
border-collapse: collapse;
margin-top: 20px;
background-color: #ffffff;
}
table, th, td {
border: 1px solid #999;
}
th, td {
padding: 8px;
text-align: left;
}
th {
background-color: #c0c0c0;
font-weight: bold;
}
tbody tr:hover {
background-color: #e8e8ff;
}
/* Preserve whitespace and line breaks */
.license-text {
white-space: pre-wrap;
word-wrap: break-word;
font-family: 'Courier New', monospace;
background-color: #f5f5f5;
padding: 10px;
border: 1px solid #999;
}

View File

@@ -1,58 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css">
<title>FS²</title>
</head>
<body>
{% include "navbar.j2" %}
<h1>Impressum</h1>
<p>Angaben gemäß § 5 DDG</p>
<p>
Max Muster - Musterberuf<br>
c/o Beispielbüro<br>
Musterweg<br>
12345 Musterstadt <br>
</p>
<p>
<strong>Vertreten durch: </strong><br>
Max Muster<br>
</p>
<p>
<strong>Kontakt:</strong><br>
Telefon: 01234-789456<br>
Fax: 1234-56789<br>
E-Mail: <a>max@muster.de</a>
</p>
<p>
<strong>Aufsichtsbehörde:</strong><br>
Musteraufsicht Musterstadt<br>
</p>
<p>
<strong>Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV:</strong><br>
Max Muster <br>
Musterweg<br>
12345 Musterstadt<br>
</p>
<p>
<strong>Verbraucherstreitbeilegung / Universalschlichtungsstelle</strong>
<br>Wir nehmen nicht an Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle teil und sind dazu auch nicht verpflichtet.
</p>
<p>
<strong>Haftungsausschluss: </strong> <br><br>
<strong>Haftung für Inhalte</strong><br>
Die Inhalte unserer Seiten wurden mit größter Sorgfalt erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs.1 DDG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 DDG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen.<br><br>
<strong>Haftung für Links</strong><br>
Unser Angebot enthält Links zu externen Webseiten Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Die verlinkten Seiten wurden zum Zeitpunkt der Verlinkung auf mögliche Rechtsverstöße überprüft. Rechtswidrige Inhalte waren zum Zeitpunkt der Verlinkung nicht erkennbar. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist jedoch ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Links umgehend entfernen.
</p>
</body>
</html>

View File

@@ -1,53 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css">
<title>FS²</title>
</head>
<body>
{% include "navbar.j2" %}
<h1>Formel(sammlung)²</h1>
<table>
<thead>
<tr>
<th>Title</th>
<th>Repo</th>
<th>Upload Date</th>
<th>Git commit</th>
</tr>
</thead>
<tbody>
{% for item in items %}
<tr>
<td>
<a href="{{ item.url }}">{{ item.title }}</a>
{% if item.author %}
<br>by {{ item.author }}
{% endif %}
</td>
<td>
{% if item.git_repo %}
<a href="{{ item.git_repo }}">{{ item.git_repo_type }}</a>
{% else %}
N/A
{% endif %}
</td>
<td>
{{ item.date }}
</td>
<td>
{% if item.git_repo %}
{{ item.git_commit }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</body>
</html>

View File

@@ -1,27 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css">
<title>FS²</title>
</head>
<body>
{% include "navbar.j2" %}
<h1>License</h1>
<p class="license-text">
Copyright {{thisYear}} Alexander
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
<p>
Cheatsheets are licensed under their respective licenses as indicated in their Git repositories.
</p>
</body>
</html>

View File

@@ -1,8 +0,0 @@
<nav class="navbar">
<h3>Formel(sammlung)²</h3>
<a href="index.html">Home</a>
<a href="impressum.html">Impressum</a>
<a href="license.html">License</a>
</nav>