Skip to content

Commit 1311dea

Browse files
committed
update template
1 parent b6f7cab commit 1311dea

20 files changed

+443
-42
lines changed

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "LaTeX4Ei Devcontainer",
3+
"image": "makeappdev/uselatex:latest",
4+
"extensions": [
5+
"eamodio.gitlens",
6+
"James-Yu.latex-workshop",
7+
"ms-azuretools.vscode-docker",
8+
"ms-vscode-remote.vscode-remote-extensionpack",
9+
"ms-vscode.cmake-tools",
10+
"twxs.cmake"
11+
],
12+
}

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: 🔍 Search for existing issues first.
4+
url: https://github.com/latex4ei/Allgemein/issues
5+
about: Please search to see if an issue already exists, either in this repo or our common issue in https://github.com/latex4ei/Allgemein/issues
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
labels: [enhancement]
4+
assignees: []
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
**Is your feature request related to a problem? Please describe.**
11+
- type: textarea
12+
id: problem-description
13+
attributes:
14+
label: Problem Description
15+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
16+
17+
- type: markdown
18+
attributes:
19+
value: |
20+
**Describe the solution you'd like**
21+
- type: textarea
22+
id: solution-description
23+
attributes:
24+
label: Solution Description
25+
description: A clear and concise description of what you want to happen.
26+
27+
- type: markdown
28+
attributes:
29+
value: |
30+
**Describe alternatives you've considered**
31+
- type: textarea
32+
id: alternatives-description
33+
attributes:
34+
label: Alternatives Description
35+
description: A clear and concise description of any alternative solutions or features you've considered.
36+
37+
- type: markdown
38+
attributes:
39+
value: |
40+
**Additional context**
41+
- type: textarea
42+
id: additional-context
43+
attributes:
44+
label: Additional Context
45+
description: Add any other context or screenshots about the feature request here.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Inhaltlicher Fehler
3+
about: Hilf uns Fehler zu Verbessern
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Fehlerbeschreibung**
11+
Beschreibe hier den Fehler
12+
13+
**Referenz**
14+
Wenn möglich immer eine Referenz zum Skript o.ä. angeben oder als Screenshot mit einfügen.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Inhaltlicher Fehler
2+
description: Hilf uns Fehler zu Verbessern
3+
labels: [bug]
4+
assignees: []
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
**Fehlerbeschreibung**
11+
- type: textarea
12+
id: error-description
13+
attributes:
14+
label: Fehlerbeschreibung
15+
description: Beschreibe hier den Fehler
16+
17+
- type: markdown
18+
attributes:
19+
value: |
20+
**Referenz**
21+
- type: textarea
22+
id: reference
23+
attributes:
24+
label: Referenz
25+
description: Wenn möglich immer eine Referenz zum Skript o.ä. angeben oder als Screenshot mit einfügen.

.github/pull_request_template.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Vorschlag Fehlerkorrektur
3+
about: Du hast einen Fehler gefunden und willst ihn korrigieren
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Fehlerbeschreibung**
11+
Beschreibe hier den Fehler
12+
13+
**Referenz**
14+
Wenn möglich immer eine Referenz zum Skript o.ä. angeben oder als Screenshot mit einfügen.

.github/workflows/ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.12.2'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r scripts/requirements.txt
24+
- name: Run pytest
25+
run: pytest
26+
27+
build:
28+
runs-on: ubuntu-latest
29+
container: makeappdev/uselatex:latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Configure Git safe directory with GITHUB_WORKSPACE
36+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
37+
38+
# Build documents via CMake
39+
- name: Build documents
40+
run: |
41+
cmake --version
42+
pdflatex --version
43+
mkdir -p build && cd build
44+
cmake ..
45+
make
46+
47+
# Fetch default branch
48+
- name: Fetch default branch
49+
run: |
50+
git fetch origin ${{ github.event.repository.default_branch }}
51+
52+
# Run latexdiff on each document by retrieving the original .tex file from the default branch.
53+
- name: Run latexdiff on documents
54+
run: |
55+
# Install latexdiff if not present
56+
apt-get install -y latexdiff
57+
58+
# Create a directory to hold diff outputs.
59+
mkdir -p diff
60+
mkdir -p temp
61+
62+
# Loop over each PDF in the build folder.
63+
for pdf in build/*.pdf; do
64+
# Extract the basename (e.g. "document" from "document.pdf")
65+
filename=$(basename "$pdf" .pdf)
66+
67+
if [ -f "$filename.tex" ]; then
68+
# Check if the file exists in the default branch using git cat-file.
69+
if git cat-file -e origin/${{ github.event.repository.default_branch }}:"$filename.tex" 2>/dev/null; then
70+
echo "Running latexdiff on $filename.tex"
71+
# Retrieve the file from the default branch directly into a temporary file.
72+
git show origin/${{ github.event.repository.default_branch }}:"$filename.tex" > temp/"$filename"_old.tex
73+
# Generate a diff TeX file using the original (default branch) and current file.
74+
latexdiff temp/"$filename"_old.tex "$filename.tex" > diff/"${filename}_diff.tex"
75+
# Compile the diff file to produce a diff PDF.
76+
pdflatex -output-directory=diff diff/"${filename}_diff.tex"
77+
else
78+
echo "Skipping $filename: $filename.tex not found in the default branch."
79+
fi
80+
else
81+
echo "Skipping $filename: $filename.tex not found in the current branch."
82+
fi
83+
done
84+
85+
# Upload the PDFs produced by build.
86+
- name: Upload build artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: build
90+
path: build/*.pdf
91+
92+
# Upload the diff PDFs produced by latexdiff.
93+
- name: Upload latexdiff artifact
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: latexdiff
97+
path: diff/*.pdf
98+
99+
- name: Prepare Deployment
100+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
101+
run: |
102+
mkdir -p export
103+
echo "# This branch is for deployment only" >> export/README.md
104+
cp build/*.pdf export
105+
cp build/git.id export
106+
107+
- name: Deploy
108+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
109+
uses: JamesIves/[email protected]
110+
with:
111+
branch: gh-pages
112+
folder: export
113+
single-commit: true
114+
silent: true

.github/workflows/update.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update README and LaTeX Build File
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
update-and-create-pr:
8+
runs-on: ubuntu-latest
9+
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
DEFAULT_BRANCH: ""
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.12.2'
22+
23+
- name: Run update script
24+
run: python scripts/update_files.py
25+
26+
- name: Configure Git
27+
run: |
28+
git config user.name "github-actions[bot]"
29+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
30+
31+
- name: Get default branch
32+
run: echo "DEFAULT_BRANCH=$(gh api repos/${{ github.repository }} --jq .default_branch)" >> $GITHUB_ENV
33+
34+
- name: Commit changes to a new branch
35+
run: |
36+
git checkout -b changes/${{ github.run_id }}
37+
git add .
38+
git commit -m "Apply automated updates"
39+
git push -u origin changes/${{ github.run_id }}
40+
41+
- name: Create Pull Request
42+
run: |
43+
gh pr create --base $DEFAULT_BRANCH --head changes/${{ github.run_id }} --title "Specify project URLs and CMake project" --body "Please review the changes applied by the automated script."

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build/
22

3-
Analysis-2.pdf
3+
/*.pdf
44

55
## Core latex/pdflatex auxiliary files:
66
*.aux
@@ -111,4 +111,6 @@ sympy-plots-for-*.tex/
111111

112112
# xindy
113113
*.xdy
114-
StochastischeSignale.pdf
114+
git.id
115+
*.DS_Store
116+
*.pyc

0 commit comments

Comments
 (0)