Skip to content

Commit 01ad85d

Browse files
committed
update template
1 parent 3ee8e12 commit 01ad85d

19 files changed

+529
-0
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: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
# Allows you to run this workflow manually from the Actions tab
7+
workflow_dispatch:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.12.2'
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -r scripts/requirements.txt
22+
- name: Run pytest
23+
run: pytest
24+
25+
build:
26+
runs-on: ubuntu-latest
27+
container: makeappdev/uselatex:latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Configure Git safe directory with GITHUB_WORKSPACE
34+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
35+
36+
# Build documents via CMake
37+
- name: Build documents
38+
run: |
39+
cmake --version
40+
pdflatex --version
41+
42+
# Create and enter the build directory.
43+
mkdir -p build && cd build
44+
cmake ..
45+
make
46+
47+
# Prepare the "original" version from the default branch.
48+
- name: Checkout default branch for diff
49+
run: |
50+
git fetch origin ${{ github.event.repository.default_branch }}
51+
git worktree add original origin/${{ github.event.repository.default_branch }}
52+
53+
# Run latexdiff on each document.
54+
- name: Run latexdiff on documents
55+
run: |
56+
# Install latexdiff if not present
57+
apt-get install -y latexdiff
58+
59+
# Create a directory to hold diff outputs.
60+
mkdir -p diff
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" ] && [ -f original/"$filename.tex" ]; then
68+
echo "Running latexdiff on $filename.tex"
69+
# Generate a diff TeX file.
70+
latexdiff original/"$filename.tex" "$filename.tex" > diff/"${filename}_diff.tex"
71+
# Compile the diff file to produce a diff PDF.
72+
pdflatex -output-directory=diff diff/"${filename}_diff.tex"
73+
else
74+
echo "Skipping $filename: Corresponding .tex file not found in one of the branches."
75+
fi
76+
done
77+
78+
# Upload the PDFs produced by build.
79+
- name: Upload build artifact
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: build-artifact
83+
path: build/*.pdf
84+
85+
# Upload the diff PDFs produced by latexdiff.
86+
- name: Upload latexdiff artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: latexdiff-artifact
90+
path: diff/*.pdf
91+
- name: Comment on PR with artifact link
92+
if: ${{ github.event_name == 'pull_request' }}
93+
uses: actions/github-script@v6
94+
with:
95+
github-token: ${{ secrets.GITHUB_TOKEN }}
96+
script: |
97+
const pr_number = context.payload.pull_request.number
98+
const run_id = process.env.GITHUB_RUN_ID
99+
const run_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}`
100+
await github.rest.issues.createComment({
101+
owner: context.repo.owner,
102+
repo: context.repo.repo,
103+
issue_number: pr_number,
104+
body: `:robot: The artifacts from this build are available [here](${run_url}).`
105+
})
106+
- name: Prepare Deployment
107+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
108+
run: |
109+
mkdir -p export
110+
echo "# This branch is for deployment only" >> export/README.md
111+
cp build/*.pdf export
112+
cp build/git.id export
113+
- name: Deploy
114+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
115+
uses: JamesIves/[email protected]
116+
with:
117+
branch: gh-pages
118+
folder: export
119+
single-commit: true
120+
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
build/
2+
3+
/*.pdf
4+
15
## Core latex/pdflatex auxiliary files:
26
*.aux
37
*.lof
@@ -107,3 +111,6 @@ sympy-plots-for-*.tex/
107111

108112
# xindy
109113
*.xdy
114+
git.id
115+
*.DS_Store
116+
*.pyc

0 commit comments

Comments
 (0)