summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/shdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-02 23:59:16 +0000
committerKarl Berry <karl@freefriends.org>2015-09-02 23:59:16 +0000
commit42bfcf8ad29b80c26850bc74b566386ea436ad47 (patch)
tree8e12ed94fb8eebe1777cfe6e6c19b754b00e2d35 /Master/texmf-dist/tex/latex/shdoc
parent3f1f1cefd70c2c51b5ebf053549cea2c2709d2d7 (diff)
shdoc (2sep15)
git-svn-id: svn://tug.org/texlive/trunk@38277 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/shdoc')
-rw-r--r--Master/texmf-dist/tex/latex/shdoc/shdoc.sty208
1 files changed, 165 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/shdoc/shdoc.sty b/Master/texmf-dist/tex/latex/shdoc/shdoc.sty
index 3640fd38c4e..8bb5283f5d4 100644
--- a/Master/texmf-dist/tex/latex/shdoc/shdoc.sty
+++ b/Master/texmf-dist/tex/latex/shdoc/shdoc.sty
@@ -1,62 +1,184 @@
- %% shdoc.sty
- %% 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
- %
-\ProvidesPackage{shdoc}
+%%
+%% 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}
-
-\def\shdocversion{v1.2}
-
-
-\typeout{-----------------------------------------------------------------}
-\typeout{Package for documenting terminal operations by RL-Systems (c)}
-\typeout{\shdocversion , 03/2015}
-\typeout{-----------------------------------------------------------------}
-
+\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}
-
-%% New Float
+\let\@shlistname\relax
+\gdef\shlistname#1{\gdef\@shlistname{#1}}
+\shlistname{List of Terminal Sessions}
\newfloat{sh}{tbph}{lsh}
\restylefloat*{sh}
\floatstyle{plain}
-\floatname{sh}{Terminal~Session}
+\let\@shfloatname\relax
+\gdef\shfloatname#1{\gdef\@shfloatname{#1}}
+\shfloatname{Terminal~Session}
+\floatname{sh}{\@shfloatname}
\captionsetup[sh]{position=bottom}
-\newcommand{\listofsh}{\listof{sh}{List of Terminal Sessions}}
+\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 0\theshlinenumber\else \theshlinenumber\fi\normalsize\ \ \textcolor{green!80!yellow}{\@shuser @\@shmachine}%
- \ \ifx&#1&%
- \textcolor{RoyalBlue}{\~\ \$}
- \else
- \textcolor{RoyalBlue}{#1\ \$}
- \fi\ #2\stepcounter{shlinenumber}\par
-}
-\long\def\shoutput#1#2{\ttfamily%
- \noindent\scriptsize\ifnum\value{shlinenumber}<10 0\theshlinenumber\else \theshlinenumber\fi\normalsize \begin{tabular}{l l}\ifx&#1& \else\fcolorbox{white!60!gray}{white!60!gray}{[#1]}\fi
- & #2\stepcounter{shlinenumber}\end{tabular}\par
+\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
-\newmdenv[linecolor=white,backgroundcolor=gray,settings=\setcounter{shlinenumber}{1}]{shbox} \ No newline at end of file
+
+\endinput
+%%
+%% End of file `shdoc.sty'.