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 # expex forward references with \gathertags
*-tags.tex *-tags.tex
main.ptc main.ptc
*temp.tex
.DS_Store
words.txt

View File

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

View File

@ -67,9 +67,9 @@ function run_pandoc_appendix {
filename=$(basename -- "$f") filename=$(basename -- "$f")
filename="${filename%.*}" filename="${filename%.*}"
pandoc --lua-filter templates/germanquotes.lua --citeproc --filter pandoc-crossref \ pandoc --lua-filter templates/germanquotes.lua --citeproc --filter pandoc-crossref \
-M cref=true --top-level-division=chapter \ -M cref=true --top-level-division=chapter \
--bibliography library/library.bib --biblatex \ --bibliography library/library.bib --biblatex \
-o appendix/generated/$filename.tex appendix/$filename.md -o appendix/generated/$filename.tex appendix/$filename.md
done done
} }

View File

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

View File

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

View File

@ -1,48 +1,44 @@
kind: pipeline kind: pipeline
type: docker 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 name: build
steps: steps:
- name: pandoc - name: pandoc
image: fastexitlane/pandoc-latex:latest pull: always
image: kingofdog/pandoc-latex:latest
commands: commands:
- ./build.sh pandoc - ./build.sh pandoc
- name: prepare-files
image: kingofdog/pandoc-latex:latest
commands:
- ci_commit_sha_short=`git rev-parse --short $CI_COMMIT_SHA` - 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 - name: upload
image: plugins/s3 image: plugins/s3
settings: settings:
bucket: praxisarbeit-artifacts bucket:
from_secret: minio_bucket
access_key: access_key:
from_secret: minio_access_key from_secret: minio_access_key
secret_key: secret_key:
from_secret: minio_secret_key from_secret: minio_secret_key
source: ./*.pdf source: ./*.pdf
region: eu-dogland region: eu-dogland
target: /version-${DRONE_BRANCH}-${DRONE_BUILD_NUMBER} target: /
path_style: true path_style: true
endpoint: https://minio.kingofdog.de endpoint: https://minio.kingofdog.de
depends_on:
- prepare-files
- name: release - name: release
image: plugins/gitea-release image: plugins/gitea-release
settings: settings:
@ -52,3 +48,26 @@ steps:
files: ./*.pdf files: ./*.pdf
when: when:
event: tag 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", "label": "latexmk",
"type": "shell", "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": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
}, },
"dependsOrder": "sequence", "problemMatcher": []
"dependsOn": [
"clean"
]
}, },
{ {
"label": "clean", "label": "clean",
"type": "shell", "type": "shell",
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh clean", "command": "./build.sh clean",
"group": "none" "windows": {
"command": "docker run --rm -u 1000 -v '${workspaceFolder}:/work/' -w /work/ fastexitlane/pandoc-latex:latest ./build.sh clean"
},
"group": "none",
"problemMatcher": []
}, },
{ {
"label": "wordcount", "label": "wordcount",
"type": "shell", "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", "group": "none",
"problemMatcher": [] "problemMatcher": []
}, },
@ -36,6 +43,9 @@
"windows": { "windows": {
"command": "wsl cat chapter/out.md `| tr 'A-ZÄÖÜ' 'a-zäöü' `| sed 's/-/ /g' `| sed 's/[^a-zäöü]//g' `> words.txt" "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", "group": "none",
"problemMatcher": [] "problemMatcher": []
} }