%%
%% This is file `shdoc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% shdoc.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright 2015 Simon M. Laube
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `author maintained'.
%% 
%% The Current Maintainer of this work is S. M. Laube
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{shdoc}[2015/05/24 v2.0 Package for documenting terminal operations]
\RequirePackage[dvipsnames]{xcolor}
\RequirePackage{float}
\RequirePackage{caption}
\RequirePackage{mdframed}
\RequirePackage{kvoptions}

\begin{sh}
    \shuser{simon}
    \shmachine{linuxmint}
    \begin{shbox}
        \shline{}{cd Desktop/}
        \shline{Desktop/}{xsensors -help}
        \shoutput{}{}
        \shoutput{}{\underline{Options:}}
        \shoutput{}{}
        \shoutput{-f} {Display all temperatures in Fahrenheit.}
        \shoutput{-h} {Display this help text and exit.}
        \shoutput{-c} {+filename Specify the libsensors configuration file.}
        \shoutput{-i} {+filename Specify the image file to use as a theme.}
        \shoutput{-t} {+time Specify the update time in number of seconds.}
        \shoutput{-v} {Display version number.}
    \end{shbox}
    \caption{The options of \textit{xsensors}}
    \label{sh:xsensor}
\end{sh}
\DeclareStringOption[gray!70]{backgroundcolor}
\DeclareStringOption[green!80!yellow]{usernamecolor}
\DeclareStringOption[green!80!yellow]{machinenamecolor}
\DeclareStringOption[RoyalBlue]{pathcolor}
\DeclareStringOption[RoyalBlue]{indicatorcolor}
\DeclareStringOption[green!80!yellow]{separatorcolor}
\DeclareStringOption[white!60!gray]{optioncolor}
\DeclareStringOption[black]{textcolor}
\DeclareStringOption[\$]{indicatorsymbol}
\DeclareStringOption[\~]{rootpathsymbol}
\DeclareStringOption[@]{separatorsymbol}
\ProcessKeyvalOptions*
\def\shpreset#1{\csname sh@preset@#1\endcsname}
\def\shpresetdef#1#2{
\expandafter\gdef\csname sh@preset@#1\endcsname{\shpreset{default} #2}
}
\def\shchangecolor#1#2{\expandafter\gdef\csname shdoc@#1\endcsname{#2}}
\let\shchangesymbol\shchangecolor
\def\sh@preset@default{
\shchangecolor{backgroundcolor}{gray!70}
\shchangecolor{usernamecolor}{green!80!yellow}
\shchangecolor{machinenamecolor}{green!80!yellow}
\shchangecolor{pathcolor}{RoyalBlue}
\shchangecolor{indicatorcolor}{RoyalBlue}
\shchangecolor{separatorcolor}{green!80!yellow}
\shchangecolor{optioncolor}{white!60!gray}
\shchangecolor{textcolor}{black}
\shchangesymbol{indicatorsymbol}{\$}
\shchangesymbol{rootpathsymbol}{\~}
\shchangesymbol{separatorsymbol}{@}
}
\shpresetdef{mint}{\shpreset{default}}
\shpresetdef{arrows}{
\shchangecolor{usernamecolor}{red}
\shchangecolor{machinenamecolor}{green!80!yellow}
\shchangecolor{separatorcolor}{white}
\shchangecolor{indicatorsymbol}{$\gg$}
\shchangecolor{indicatorcolor}{green!80!yellow}
\shchangecolor{backgroundcolor}{black}
\shchangecolor{textcolor}{white}
\shchangecolor{optioncolor}{gray}
}
\shpresetdef{darkblue}{
\definecolor{shdarkblue}{RGB}{7,75,138}
\shchangecolor{backgroundcolor}{shdarkblue}
\shchangecolor{textcolor}{white}
\shchangecolor{separatorcolor}{white}
\shchangecolor{usernamecolor}{orange}
\shchangecolor{machinenamecolor}{orange}
\shchangecolor{pathcolor}{green!60!black}
\shchangecolor{optioncolor}{SkyBlue!80!black}
}
\shpresetdef{blackwhite}{
\shchangecolor{backgroundcolor}{gray!30}
\shchangecolor{textcolor}{black}
\shchangecolor{separatorcolor}{black}
\shchangecolor{usernamecolor}{gray}
\shchangecolor{machinenamecolor}{gray}
\shchangecolor{pathcolor}{gray!50!black}
\shchangecolor{optioncolor}{white}
\shchangecolor{indicatorcolor}{white}
}
\shpresetdef{airy}{
\shchangecolor{backgroundcolor}{SkyBlue!15}
\shchangecolor{usernamecolor}{Emerald}
\shchangecolor{machinenamecolor}{Emerald}
\shchangecolor{pathcolor}{orange!70}
\shchangecolor{indicatorcolor}{orange!70}
\shchangecolor{separatorcolor}{Emerald}
\shchangecolor{optioncolor}{Emerald!30}
}
\newcounter{shlinenumber}
\setcounter{shlinenumber}{0}
\let\@shlistname\relax
\gdef\shlistname#1{\gdef\@shlistname{#1}}
\shlistname{List of Terminal Sessions}
\newfloat{sh}{tbph}{lsh}
\restylefloat*{sh}
\floatstyle{plain}
\let\@shfloatname\relax
\gdef\shfloatname#1{\gdef\@shfloatname{#1}}
\shfloatname{Terminal~Session}
\floatname{sh}{\@shfloatname}
\captionsetup[sh]{position=bottom}
\def\listofsh{\listof{sh}{\@shlistname}}
\makeatletter
\let\@shuser\relax
\let\@shmachine\relax
\def\shuser#1{\gdef\@shuser{#1}}
\def\shmachine#1{\gdef\@shmachine{#1}}
\long\def\shline#1#2{
\ttfamily\noindent\scriptsize
\ifnum\value{shlinenumber}<10
\textcolor{\shdoc@textcolor}{0\theshlinenumber}
\else
\textcolor{\shdoc@textcolor}{\theshlinenumber}
\fi
\normalsize\ \ \textcolor{\shdoc@usernamecolor}{\@shuser}\ignorespaces
\textcolor{\shdoc@separatorcolor}{\shdoc@separatorsymbol}\ignorespaces
\textcolor{\shdoc@machinenamecolor}{\@shmachine}\ignorespaces
\ \ifx&#1&\ignorespaces
\textcolor{\shdoc@pathcolor}{\shdoc@rootpathsymbol\ }\ignorespaces
\textcolor{\shdoc@indicatorcolor}{\shdoc@indicatorsymbol}
\else\ignorespaces
\textcolor{\shdoc@pathcolor}{#1\ }\ignorespaces
\textcolor{\shdoc@indicatorcolor}{\shdoc@indicatorsymbol}\ignorespaces
\fi\ \textcolor{\shdoc@textcolor}{#2}
\stepcounter{shlinenumber}\par
}
\long\def\shoutput#1#2{
\ttfamily\noindent\scriptsize
\ifnum\value{shlinenumber}<10
\textcolor{\shdoc@textcolor}{0\theshlinenumber}
\else
\textcolor{\shdoc@textcolor}{\theshlinenumber}
\fi
\normalsize
\ifx&#1&
\textcolor{\shdoc@textcolor}{#2}\stepcounter{shlinenumber}
\else
\fcolorbox{\shdoc@optioncolor}{\shdoc@optioncolor}{\textcolor{\shdoc@textcolor}{[#1]}}
\begin{tabular}{l l}
& \textcolor{\shdoc@textcolor}{#2}\stepcounter{shlinenumber}
\end{tabular}
\fi\par
}
\newmdenv[linecolor=white,backgroundcolor=\shdoc@backgroundcolor,
settings=\setcounter{shlinenumber}{1}]{shbox}
\makeatother

\endinput
%%
%% End of file `shdoc.sty'.
