%%%
% driver file of changes package
\newcommand{\docversion}{4.2.1}

\documentclass[titlepage, parskip=half, toc=flat, cleardoublepage=empty, captions=nooneline, origlongtable, english]{scrartcl}

% code definition and documentation
\usepackage{doc}

% basis layout
\usepackage[font=charter, oneside]{basis}

% listings
\usepackage{listings}
\lstset{
	language=[AlLaTeX]TeX,
	float=hbp,
	numberstyle=\tiny\ttfamily,
	basicstyle=\ttfamily,
	identifierstyle=\color{DimGrey},
	morekeywords={
	},
	keywordstyle=\color{SteelBlue},
	commentstyle=\itshape\color{Thistle},
	backgroundcolor=\color{PapayaWhip},
	columns=fixed,
	tabsize=4,
	frame=single,
	extendedchars=true,
	showspaces=false,
	showstringspaces=false,
	numbers=none,
	breaklines=true,
	breakindent=3em,
	breakautoindent=true,
	captionpos=t,
	xleftmargin=1em,
	xrightmargin=1em,
	lineskip=0pt,
	numbersep=1em,
	classoffset=1,
	morekeywords={
		added,
		changes,
		color,
		comment,
		deleted,
		definechangesauthor,
		highlight,
		listofchanges,
		replaced,
		style,
%
		draft,
		final,
		markup,
		addedmarkup,
		deletedmarkup,
		highlightmarkup,
		commentmarkup,
		authormarkup,
		authormarkupposition,
		authormarkuptext,
		todonotes,
		truncate,
		ulem,
		xcolor,
%
		default,
		underlined,
		bfit,
		nocolor,
%
		colored,
		uline,
		uuline,
		uwave,
		dashuline,
		dotuline,
		bf,
		it,
		sl,
		em,
%
		sout,
		xout,
%
		background,
%
		todo,
		margin,
		footnote,
%
		superscript,
		subscript,
		brackets,
		none,
%
		right,
		left,
%
		id,
		name,
%
		title,
		show,
%
		list,
		summary,
		compactsummary,
%
		setaddedmarkup,
		setdeletedmarkup,
		sethighlightmarkup,
		setcommentmarkup,
		setauthormarkup,
		setauthormarkupposition,
		setauthormarkuptext,
		settruncatewidth,
		setsummarywidth,
		setsummarytowidth,
		setsocextension,
	},
	keywordstyle=\color{Peru},
	moredelim=[s][\color{SlateGrey}]{<}{>},
	classoffset=0,
	escapechar=!
}

% minitocs
\usepackage{etoc}
\etocsettocstyle{}{}

% language selection
\selectlanguage{english}

% use change management ;)
\usepackage{changes}
\definechangesauthor[name={Ekkart Kleinod}, color=Sienna]{EK}
\setcommentmarkup{%
	\IfIsColored%
		{%
			\IfIsAnonymous{#2}%
				{%
					\todo[color=authorcolor!10, bordercolor=authorcolor, linecolor=authorcolor!70, nolist]{\footnotesize\textbf{[\arabic{authorcommentcount}]} #1}%
				}{%
					\todo[color=authorcolor!10, bordercolor=authorcolor, linecolor=authorcolor!70, nolist]{\footnotesize\textbf{[#3~\arabic{authorcommentcount}]} #1}%
				}%
		}{%
			\IfIsAnonymous{#2}%
				{%
					\todo[color=black!0, bordercolor=black, linecolor=black!70, nolist]{\footnotesize\textbf{[\arabic{authorcommentcount}]} #1}%
				}{%
					\todo[color=black!0, bordercolor=black, linecolor=black!70, nolist]{\footnotesize\textbf{[#3~\arabic{authorcommentcount}]:} #1}%
				}%
		}%
}%

% full index
\EnableCrossrefs

% with line numbers
\CodelineIndex

% formatting
\newcommand{\docpackage}[1]{\textsl{#1}}
\newcommand{\docoption}[1]{\texttt{#1}}
\newcommand{\doccommand}[1]{\texttt{\textbackslash{}#1}}

% additional description list formatting
\newlength{\mylabelwidth}
\settowidth{\mylabelwidth}{\texttt{compactsummarym}}
\setlist[description]{style=nextline, font=\normalfont, leftmargin=\mylabelwidth}

% catchall - english
\newif\ifENGLISH
\ENGLISHtrue

% german
\newif\ifGERMAN
\GERMANfalse
\iflanguage{ngerman}{\GERMANtrue\ENGLISHfalse}{}
\iflanguage{german}{\GERMANtrue\ENGLISHfalse}{}

% example environment
\newcommand{\chinputlisting}[2]{%
	\lstinputlisting[%
		backgroundcolor=\color{white},%
		xleftmargin=.5em,%
		xrightmargin=.5em,%
		frame=none,%
		belowskip=0pt%
		#1%
	]{#2}%
}
\newcommand{\chinline}[2][]{%
	\chinputlisting{#1}{userdoc/#2_in}%
}
\newcommand{\chexample}[1]{
	\ifENGLISH
		\minisec{Examples}
	\fi
	\ifGERMAN
		\minisec{Beispiele}
	\fi
	\lstinputlisting{userdoc/#1_ex}
}
\newcommand{\chresult}[1]{
	\ifENGLISH
		\minisec{Result}
	\fi
	\ifGERMAN
		\minisec{Resultat}
	\fi
	\begin{quote}
		\input{userdoc/#1_ex}
	\end{quote}
}


\newenvironment{chusage}{
	\small
	\begin{tabbing}
		m\=m\=m\=\kill
		\usagecall
}{%
	\end{tabbing}
}
\newcommand{\usagecall}{
	\ifENGLISH
		\textsl{Call}\\
	\fi
	\ifGERMAN
		\textsl{Aufruf}\\
	\fi
}
\newcommand{\usageexample}{
	\ifENGLISH
		\textsl{Examples}\\
	\fi
	\ifGERMAN
		\textsl{Beispiele}\\
	\fi
}

% important things
\newcommand{\chimportant}[1]{%
	\begin{quote}%
		\color{Teal}%
		#1%
	\end{quote}%
}

% new commands
\newcommand{\chnewcmd}[1]{
	\subsubsection{\doccommand{#1}}
	\label{sec:ui:cmd:#1}
}

% document title
\ifENGLISH
	\title{The \docpackage{changes}-package}
	\subtitle{Manual change markup --- version~\docversion}
\fi
\ifGERMAN
	\title{Das \docpackage{changes}-Paket}
	\subtitle{Manuelle Änderungsmarkierung -- Version~\docversion}
\fi

\author{Ekkart Kleinod}
\email{ekleinod@edgesoft.de}

% only description part?
%\OnlyDescription

% content
\begin{document}

	\DocInput{changes.dtx}

\end{document}