Improve automization and VSCode integration

This commit is contained in:
KingOfDog 2021-11-10 13:33:51 +01:00
parent 15a55e5d3c
commit bb80497dec
7 changed files with 98 additions and 40 deletions

5
.gitignore vendored
View File

@ -240,3 +240,8 @@ TSWLatexianTemp*
# expex forward references with \gathertags
*-tags.tex
main.ptc
*temp.tex
.DS_Store
words.txt

View File

@ -0,0 +1,12 @@
\addchap{Executive Summary}
% Problemstellung
% Zielsetzung
% Methodik
% Ergebnisse
% Ausblick

View File

@ -44,9 +44,11 @@
\stopcontents
\renewcommand{\thechapter}{\arabic{chapter}}%
\setcounter{chapter}{1}
\cref{appendix}{Anhang}{Anhänge}
}
% Reduzierung der Abstände zwischen Überschriften und Text
% \RedeclareSectionCommand[beforeskip=.0001\baselineskip, afterskip=.0001\baselineskip]{chapter}
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{section}
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{subsection}
\RedeclareSectionCommand[afterskip=.0001\baselineskip]{subsubsection}
@ -57,6 +59,7 @@
% Neue Deutsche Rechtschreibung und Deutsche Standardtexte
\usepackage[ngerman]{babel}
\usepackage{hyphenat}
% 1/2-zeiliger Zeilenabstand
\usepackage[onehalfspacing]{setspace}
@ -64,9 +67,18 @@
% Für die Verwendung von Grafiken
\usepackage{graphicx}
% Bessere Zahlen und Einheiten
\usepackage{siunitx}
% Bessere Tabellen
\usepackage{tabularx}
% Ragged Tabellene
\usepackage{ragged2e}
\newcolumntype{C}{>{\Centering}X}
\newcolumntype{L}{>{\RaggedRight}X}
\newcolumntype{R}{>{\RaggedLeft}X}
% diagonal unterteilte Tabellencellen
\usepackage{diagbox}
@ -236,7 +248,7 @@
baselinestretch=1,
breaklines=true,
breakautoindent=true,
fontsize=\small
fontsize=\footnotesize
}
\newenvironment{code}{\captionsetup{type=listing}}{}

View File

@ -6,7 +6,7 @@
\newcommand{\dokumentenuntertitel}{Untertitel}
\newcommand{\dokumentenautor}{Marcel Struck}
\newcommand{\matrikelnr}{100228}
\newcommand{\dokumentenautoradresse}{Adresse}
\newcommand{\dokumentenautoradresse}{Straße Hausnummer, PLZ Ort}
\newcommand{\dokumentenpruefer}{Prüfer}
\newcommand{\studiengang}{Software Engineering}
\newcommand{\studiengruppe}{BFWS420A}

View File

@ -1,48 +1,44 @@
kind: pipeline
type: docker
name: test
steps:
- name: hunspell_chapters
image: fastexitlane/hunspell:latest
commands:
- export HUNSPELL_FINDINGS=`for filename in chapter/*.md; do hunspell -l -d de_DE_frami,en_US -p ./.hunspellignore $filename; done | sort | uniq`
- echo $HUNSPELL_FINDINGS
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
failure: ignore
- name: hunspell_appendix
image: fastexitlane/hunspell:latest
commands:
- export HUNSPELL_FINDINGS=`for filename in appendix/*.tex; do hunspell -l -d de_DE_frami,en_US -p ./.hunspellignore -t $filename; done | sort | uniq`
- echo $HUNSPELL_FINDINGS
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
failure: ignore
---
kind: pipeline
type: docker
name: build
steps:
- name: pandoc
image: fastexitlane/pandoc-latex:latest
pull: always
image: kingofdog/pandoc-latex:latest
commands:
- ./build.sh pandoc
- name: prepare-files
image: kingofdog/pandoc-latex:latest
commands:
- ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA`
- mv out/main.pdf "$(date +"%F-%H-%M")_$DRONE_REPO_NAME.pdf"
- cp out/main.pdf "$(date +"%F-%H-%M")_${DRONE_REPO_NAME}_${DRONE_BUILD_NUMBER}.pdf"
depends_on:
- pandoc
- name: log
image: kingofdog/pandoc-latex:latest
commands:
- cat out/main.log
- ls -l out
- ls -l appendix/generated
depends_on:
- pandoc
- name: upload
image: plugins/s3
settings:
bucket: praxisarbeit-artifacts
bucket:
from_secret: minio_bucket
access_key:
from_secret: minio_access_key
secret_key:
from_secret: minio_secret_key
source: ./*.pdf
region: eu-dogland
target: /version-${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
target: /
path_style: true
endpoint: https://minio.kingofdog.de
depends_on:
- prepare-files
- name: release
image: plugins/gitea-release
settings:
@ -52,3 +48,26 @@ steps:
files: ./*.pdf
when:
event: tag
depends_on:
- prepare-files
- name: hunspell_chapters
image: kingofdog/hunspell:latest
failure: ignore
commands:
- sed -i -E 's/\\acf?s?p?\{([^}]+)\}/\1/g' chapter/out.tex
- sed -i -E 's/\\\w+\{[^}]+\}//g' chapter/out.tex
- export HUNSPELL_FINDINGS="`hunspell -l -i UTF-8 -d de_DE_frami,en_US -p ./.hunspellignore chapter/out.tex | sort | uniq`"
- export HUNSPELL_FINDINGS_COUNT=`echo $HUNSPELL_FINDINGS | wc -w`
- echo "Found $HUNSPELL_FINDINGS_COUNT different incorrect words."
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
depends_on:
- pandoc
- name: hunspell_appendix
image: kingofdog/hunspell:latest
failure: ignore
commands:
- export HUNSPELL_FINDINGS=`for filename in appendix/*.tex; do hunspell -l -d de_DE_frami,en_US -p ./.hunspellignore -t $filename; done | sort | uniq`
- echo $HUNSPELL_FINDINGS
- '[ -z "$HUNSPELL_FINDINGS" ] && exit 0 || exit 1'
depends_on:
- pandoc

View File

@ -6,26 +6,33 @@
{
"label": "latexmk",
"type": "shell",
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh pandoc",
"command": "./build.sh pandoc",
"windows": {
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh pandoc"
},
"group": {
"kind": "build",
"isDefault": true
},
"dependsOrder": "sequence",
"dependsOn": [
"clean"
]
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh clean",
"group": "none"
"command": "./build.sh clean",
"windows": {
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh clean"
},
"group": "none",
"problemMatcher": []
},
{
"label": "wordcount",
"type": "shell",
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest pandoc --lua-filter=/work/wordcount.lua /work/chapter/out.md",
"command": "pandoc --lua-filter=wordcount.lua chapter/out.md",
"windows": {
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest pandoc --lua-filter=/work/wordcount.lua /work/chapter/out.md"
},
"group": "none",
"problemMatcher": []
},
@ -36,6 +43,9 @@
"windows": {
"command": "wsl cat chapter/out.md `| tr 'A-ZÄÖÜ' 'a-zäöü' `| sed 's/-/ /g' `| sed 's/[^a-zäöü]//g' `> words.txt"
},
"osx": {
"command": "cat chapter/out.md | tr 'A-ZÄÖÜ' 'a-zäöü' | sed -E 's/\\\\acf?s?p?\\{([^}]+)\\}/\\1/g' | sed 's/-/ /g' | sed 's/[^a-zäöü ]//g' | tr -s '[[:space:]]' '\\n' | sort | uniq -c | sort -nr | head -n100 > words.txt"
},
"group": "none",
"problemMatcher": []
}