Skip to content

Commit

Permalink
Add issues hyperlink and fix CI (#6)
Browse files Browse the repository at this point in the history
* add issues url

* update CI

Update ci.yml

fix build error in cheatsheet_example.tex

Update write-gitid.sh

* add issues url to test files

* Update write-gitid.sh

* Update write-gitid.sh

* change link position in latex4ei_sheet.cls

* fix language not working

I dont know why, but this fixes the error that the language is set to german when english is passed as option. valid options are "english" and "ngerman" (not "german")

* change default url placeholder

* Update .github/workflows/ci.yml

Co-authored-by: Markus Hofbauer <[email protected]>

* Delete update.yml

* Add git stuff to cheatsheet class

* change if clause to `GitNiceDate` in latex4ei_sheet.cls

* fix languages swapped

* update date

* Update .github/workflows/ci.yml

Co-authored-by: Markus Hofbauer <[email protected]>

* update .gitignore and remove md templates

---------

Co-authored-by: Markus Hofbauer <[email protected]>
  • Loading branch information
dariusptrs and hofbi authored Jul 8, 2024
1 parent 00f0ede commit 8137e9f
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 74 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "LaTeX4Ei Devcontainer",
"image": "makeappdev/uselatex:latest",
"extensions": [
"eamodio.gitlens",
"James-Yu.latex-workshop",
"ms-azuretools.vscode-docker",
"ms-vscode-remote.vscode-remote-extensionpack",
"ms-vscode.cmake-tools",
"twxs.cmake"
],
}
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 🔍 Search for existing issues first.
url: https://github.com/latex4ei/Allgemein/issues
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
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Feature request
description: Suggest an idea for this project
labels: [enhancement]
assignees: []

body:
- type: markdown
attributes:
value: |
**Is your feature request related to a problem? Please describe.**
- type: textarea
id: problem-description
attributes:
label: Problem Description
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

- type: markdown
attributes:
value: |
**Describe the solution you'd like**
- type: textarea
id: solution-description
attributes:
label: Solution Description
description: A clear and concise description of what you want to happen.

- type: markdown
attributes:
value: |
**Describe alternatives you've considered**
- type: textarea
id: alternatives-description
attributes:
label: Alternatives Description
description: A clear and concise description of any alternative solutions or features you've considered.

- type: markdown
attributes:
value: |
**Additional context**
- type: textarea
id: additional-context
attributes:
label: Additional Context
description: Add any other context or screenshots about the feature request here.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/inhaltlicher_fehler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Inhaltlicher Fehler
description: Hilf uns Fehler zu Verbessern
labels: [bug]
assignees: []

body:
- type: markdown
attributes:
value: |
**Fehlerbeschreibung**
- type: textarea
id: error-description
attributes:
label: Fehlerbeschreibung
description: Beschreibe hier den Fehler

- type: markdown
attributes:
value: |
**Referenz**
- type: textarea
id: reference
attributes:
label: Referenz
description: Wenn möglich immer eine Referenz zum Skript o.ä. angeben oder als Screenshot mit einfügen.
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Vorschlag Fehlerkorrektur
about: Du hast einen Fehler gefunden und willst ihn korrigieren
title: ''
labels: bug
assignees: ''

---

**Fehlerbeschreibung**
Beschreibe hier den Fehler

**Referenz**
Wenn möglich immer eine Referenz zum Skript o.ä. angeben oder als Screenshot mit einfügen.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container: makeappdev/uselatex:latest
steps:
- uses: actions/checkout@v4

- name: Configure Git safe directory with GITHUB_WORKSPACE
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- name: Build
run: |
cmake --version; pdflatex --version
mkdir -p build && cd build
cmake ..
make
- name: Prepare Deployment
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
run: |
mkdir -p export
echo "# This branch is for deployment only" >> export/README.md
cp build/doc/*.pdf export
cp build/template-files/*.pdf export
cp build/git.id export
- name: Deploy
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: export
single-commit: true
silent: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@ sympy-plots-for-*.tex/

# xindy
*.xdy
StochastischeSignale.pdf
*.DS_Store
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.12)

project(LaTeX4Ei NONE)
include(UseLATEX)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ If you want to publish your latex code you are allowed to publish the source cod
of this template as well but you have to make sure that a copy of this license is included.


© 2011-2019, LaTeX4EI
© 2011-2024, LaTeX4EI
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LaTeX4EI Template

[![Build Status](https://travis-ci.org/latex4ei/latex4ei-packages.svg?branch=master)](https://travis-ci.org/latex4ei/latex4ei-packages)
[![Actions Status](https://github.com/latex4ei/latex4ei-packages/workflows/CI/badge.svg)](https://github.com/latex4ei/latex4ei-packages)
[![Join the chat at https://gitter.im/LaTeX4Ei/Lobby](https://badges.gitter.im/LaTeX4Ei/Lobby.svg)](https://gitter.im/LaTeX4Ei/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![GitHub release](https://img.shields.io/github/release/latex4ei/latex4ei-packages.svg)](https://github.com/latex4ei/latex4ei-packages/releases/latest)
[![Github Releases](https://img.shields.io/github/downloads/latex4ei/latex4ei-packages/latest/total.svg)](https://github.com/latex4ei/latex4ei-packages/releases/latest)
Expand Down Expand Up @@ -37,4 +37,4 @@ cp -r template-files/latex4ei /usr/local/texlive/texmf-local/tex/latex/latex4ei
If you want to share your documents please refer to the LICENSE file
Read the changelog.md and known_bugs.txt and check [www.latex4ei.de](http://latex4ei.de) for updates.

© 2011-2019, LaTeX4EI
© 2011-2024, LaTeX4EI
2 changes: 1 addition & 1 deletion known_bugs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Known Bugs: 1
\section command.


© 2011-2019, LaTeX4EI
© 2011-2024, LaTeX4EI
18 changes: 7 additions & 11 deletions template-files/cheatsheet_example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

% possible options: color/nocolor, english/german, threecolumn
% default: color, english
\documentclass[english]{latex4ei/latex4ei_sheet}
\documentclass[german]{latex4ei/latex4ei_sheet}

% set document information
\title{Example\\ Cheat Sheet}
Expand All @@ -22,10 +22,6 @@

% DOCUMENT_BEGIN ===============================================================
\begin{document}

\IfFileExists{git.id}{\input{git.id}}{}
\ifdefined\GitRevision\mydate{\GitNiceDate\ (git \GitRevision)}\fi

\maketitle % requires ./img/Logo.pdf

% SECTION ====================================================================================
Expand Down Expand Up @@ -101,12 +97,12 @@ \section{Physik}
\end{symbolbox}

\begin{sectionbox}
\subsection{Einheitpräfixe}
\begin{tablebox}{l | ccccccccc}
$10^\pm$ & $21$ & $18$ & $15$ & $12$ & $9$ & $6$ & $3$ & $2$ & $1$ \\ \cmrule
$+$ & $\underset{\ir zetta}{\si{\zetta}}$ & $\underset{\ir exa}{\si{\exa}}$ & $\underset{\ir peta}{\si{\peta}}$ & $\underset{\ir tera}{\si{\tera}}$ & $\underset{\ir giga}{\si{\giga}}$ & $\underset{\ir mega}{\si{\mega}}$ & $\underset{\ir kilo}{\si{\kilo}}$ & $\underset{\ir hecto}{\si{\hecto}}$ & $\underset{\ir deca}{\si{\deca}}$ \\
$-$ & $\underset{\ir zepto}{\si{\zepto}}$ & $\underset{\ir atto}{\si{\atto}}$ & $\underset{\ir femto}{\si{\femto}}$ & $\underset{\ir pico}{\si{\pico}}$ & $\underset{\ir nano}{\si{\nano}}$ & $\underset{\ir micro}{\si{\micro}}$ & $\underset{\ir milli}{\si{\milli}}$ & $\underset{\ir centi}{\si{\centi}}$& $\underset{\ir deci}{\si{\deci}}$
\end{tablebox}
\subsection{Einheitpräfixe}
\begin{tablebox}{l | ccccccccc}
$10^\pm$ & $21$ & $18$ & $15$ & $12$ & $9$ & $6$ & $3$ & $2$ & $1$ \\ \cmrule
$+$ & $\underset{\ir zetta}{\si{\text{\zetta}}}$ & $\underset{\ir exa}{\si{\text{\exa}}}$ & $\underset{\ir peta}{\si{\text{\peta}}}$ & $\underset{\ir tera}{\si{\text{\tera}}}$ & $\underset{\ir giga}{\si{\text{\giga}}}$ & $\underset{\ir mega}{\si{\text{\mega}}}$ & $\underset{\ir kilo}{\text{kilo}}$ & $\underset{\ir hecto}{\si{\text{\hecto}}}$ & $\underset{\ir deca}{\si{\text{\deca}}}$ \\
$-$ & $\underset{\ir zepto}{\si{\text{\zepto}}}$ & $\underset{\ir atto}{\si{\text{\atto}}}$ & $\underset{\ir femto}{\si{\text{\femto}}}$ & $\underset{\ir pico}{\si{\text{\pico}}}$ & $\underset{\ir nano}{\si{\text{\nano}}}$ & $\underset{\ir micro}{\si{\text{\micro}}}$ & $\underset{\ir milli}{\si{\text{\milli}}}$ & $\underset{\ir centi}{\si{\text{\centi}}}$& $\underset{\ir deci}{\si{\text{\deci}}}$
\end{tablebox}
\end{sectionbox}


Expand Down
4 changes: 0 additions & 4 deletions template-files/cheatsheet_template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
% ======================================================================
\begin{document}

\IfFileExists{git.id}{\input{git.id}}{}
\ifdefined\GitRevision\mydate{\GitNiceDate\ (git \GitRevision)}\fi

% Title
% ----------------------------------------------------------------------
\maketitle % requires ./img/Logo.pdf
Expand Down Expand Up @@ -60,7 +57,6 @@ \section{Math}




% ======================================================================
% End
% ======================================================================
Expand Down
22 changes: 11 additions & 11 deletions template-files/latex4ei/latex4ei.sty
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
% Basic Settings
% ======================================================================

% Language
% ----------------------------------------------------------------------

\RequirePackage[english, ngerman]{babel}

\RequirePackage{iflang}
\providecommand{\EngGer}[2]{\IfLanguageName{english}{#1}{#2}}
\expandafter\selectlanguage\expandafter{\thelanguage}
\AtBeginDocument{\expandafter\selectlanguage\expandafter{\thelanguage}}


% Identify Compiler
% ----------------------------------------------------------------------
\RequirePackage{ifxetex}
Expand Down Expand Up @@ -140,17 +151,6 @@
}
}


% Language
% ----------------------------------------------------------------------

\RequirePackage[english, ngerman]{babel}

\RequirePackage{iflang}
\providecommand{\EngGer}[2]{\IfLanguageName{english}{#1}{#2}}
\expandafter\selectlanguage\expandafter{\thelanguage}
\AtBeginDocument{\expandafter\selectlanguage\expandafter{\thelanguage}}

% Graphics
% ----------------------------------------------------------------------
\RequirePackage{graphicx} % for including images
Expand Down
12 changes: 11 additions & 1 deletion template-files/latex4ei/latex4ei_sheet.cls
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,23 @@
\fancyhf{}

\AtBeginDocument{
\IfFileExists{git.id}{\input{git.id}}{}
\ifdefined\GitNiceDate\mydate{\GitNiceDate\ (git \GitRevision)}\fi
\ifdefined\GitIssuesURL
\ifdefined\setissueslinkurl
\setissueslinkurl{\GitIssuesURL} % Set the actual URL
\fi
\fi
\fancyfoot[C]{\EngGer{from}{von} \theauthor\ -- Mail: \email{\theemail}}
}
\renewcommand{\headrulewidth}{0.0pt} %obere Linie ausblenden
\renewcommand{\footrulewidth}{0.1pt} %obere Linie ausblenden

\newcommand{\issueslinkurl}{https://github.com/latex4ei/Allgemein/issues} % Default URL placeholder
\newcommand{\setissueslinkurl}[1]{\renewcommand{\issueslinkurl}{#1}}

\fancyfoot[R]{\EngGer{Last revised}{Stand}: \themydate \qquad \thepage/\pageref{LastPage}}
\fancyfoot[L]{Homepage: \url{\thewebsite} -- \EngGer{Please report mistakes \emph{immediately}}{Fehler bitte \emph{sofort} melden}.}
\fancyfoot[L]{Homepage: \url{\thewebsite} -- \EngGer{Please \href{\issueslinkurl}{report} mistakes \emph{immediately}}{Fehler bitte \emph{sofort} \href{\issueslinkurl}{melden}}.}


% Title
Expand Down
12 changes: 12 additions & 0 deletions write-gitid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@ fi
GITREV=$(git rev-list HEAD --count)
echo "\\def\\GitRevision{$GITREV}"> git.id
git show -s --format=%ci | xargs -I var_d $DATEBIN -d "var_d" +\\def\\GitNiceDate{%-d.\ %B\ %Y\ um\ %H:%M\ Uhr} >> git.id

# Get the repository's remote URL
REPO_URL=$(git remote get-url origin)

# Convert SSH URL to HTTPS URL and append /issues for the issues page
# This also ensures it works for URLs ending with .git and without
ISSUES_URL=$(echo $REPO_URL | sed -e 's/^git@github\.com:/https:\/\/github\.com\//' -e 's/\.git$//' -e 's/$/\/issues/')

echo "\\def\\GitIssuesURL{$ISSUES_URL}" >> git.id

#Copy git.id into template-files
cp git.id template-files/git.id

0 comments on commit 8137e9f

Please sign in to comment.