%! Author = soeichho
%! Date = 20.11.2020

% PDF version
\special{pdf:minorversion 7}

% Text style
\setmainfont{\mainFont}
\setstretch{\lineStretchValue}          % Space between lines
\tolerance=1000
\emergencystretch=1em

% Chapter format
\renewcommand*{\chapterformat}{
    \thechapter \hspace{10pt} \textcolor{accent-color}{|} \hspace{10pt}
}
\renewcommand*{\chapterheadstartvskip}{\vspace*{0pt}}


% Header / Footer
\clearpairofpagestyles
\KOMAoptions {
    headsepline = true,
    footsepline = true,
    plainfootsepline = true
}
\automark[chapter]{chapter}

\ihead{\headmark}
\ifoot{\author~~|~~\kurs~~|~~\date}
\ofoot{\thepage}

\renewcommand*{\headfont}{\normalfont} % Keine kursive Schrift
\renewcommand*{\footfont}{\normalfont}

\newpairofpagestyles{chapterpage}{
    \KOMAoptions {
        headsepline = false,
        footsepline = true,
        plainfootsepline = true
    }
    \ihead{}
    \ifoot{\author~~|~~\kurs~~|~~\date}
    \ofoot{\thepage}
}

\renewcommand*{\chapterpagestyle}{chapterpage}


% Listings style
\lstset{
    basicstyle=\ttfamily\small,
    frame=top,
    frame=bottom,
    breaklines=true,
    tabsize=2,
    upquote = true,
    numbers=left,
    stepnumber=1,
    numbersep=5pt,
    commentstyle=\color{teal},
    stringstyle=\color{magenta},
    keywordstyle=\color{orange}
}

\lstdefinelanguage{JSON}{
    string=[s]{"}{"},
    comment=[l]{:\ "},
    morecomment=[l]{:"},
}

\lstdefinelanguage{XML}
{
    morestring=[b]",
    morecomment=[s]{<?}{?>},
    morecomment=[s]{<!--}{-->},
    commentstyle=\color{darkolivegreen},
    moredelim=[s][\color{black}]{>}{<},
    stringstyle=\color{blue},
    identifierstyle=\color{brown},
    keywordstyle=\color{red},
    rulecolor=\color{black},
    morekeywords={xmlns, version, type, Algorithm, URI, Id, Target}% list your attributes here
}

\lstdefinelanguage{JavaScript}{
    keywords={const, let, typeof, instanceof, new, true, false, catch, function, return, null, undefined, catch, switch, var, if, in, while, for, do, else, case, default, break},
    ndkeywords={class, export, throw, import, this},
    sensitive=false,
    comment=[l]{//},
    morecomment=[s]{/*}{*/},
    morestring=[b]',
    morestring=[b]`,
    morestring=[b]"
}

\lstdefinelanguage{CSS}{
    morekeywords={color,background,margin,padding,margin,padding,font,weight,display,position,top,left,right,bottom,list,style,border,size,white,space,min,width,transition},
	sensitive=false, 
	morecomment=[l]{//}, 
	morecomment=[s]{/*}{*/}, 
	morestring=[b]", 
}


% Float listings
\newfloat{lstfloat}{htbp}{lop}
\floatname{lstfloat}{Listing}
\def\lstfloatautorefname{Listing} % needed for hyperref/auroref