From 020ed552eb79eee0bce0c1f6b8e40d8005d7767a Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 24 Sep 2013 22:35:02 +0000
Subject: skdoc (23sep13)

git-svn-id: svn://tug.org/texlive/trunk@31753 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/source/latex/skdoc/skdoc.dtx | 93 ++++++++++++++++++++------
 1 file changed, 73 insertions(+), 20 deletions(-)

(limited to 'Master/texmf-dist/source/latex/skdoc/skdoc.dtx')

diff --git a/Master/texmf-dist/source/latex/skdoc/skdoc.dtx b/Master/texmf-dist/source/latex/skdoc/skdoc.dtx
index 08dd5dd0416..f193bd64957 100644
--- a/Master/texmf-dist/source/latex/skdoc/skdoc.dtx
+++ b/Master/texmf-dist/source/latex/skdoc/skdoc.dtx
@@ -73,7 +73,7 @@
 %</driver>
 %<class>\ProvidesExplClass{skdoc}
 %<*class>
-    {2013/05/24}{1.3b}{skdoc documentation class}
+    {2013/09/23}{1.4}{skdoc documentation class}
 %</class>
 %
 %<*driver>
@@ -132,7 +132,7 @@
 % {}{\small\pagemark}
 % \pagestyle{skdoc-class}
 %
-% \version{1.3b}
+% \version{1.4}
 % \changes{1.0}{Initial version}
 % \changes{1.1}{Added support for syntax highlighting using \pkg{minted}}
 % \changes{1.1a}{Deprecate the use of \pkg{bibtex} in favour of \pkg{biblatex}}
@@ -140,6 +140,11 @@
 % \changes{1.2b}{Use \pkg{inconsolata}. Don't use \pkg{ascii}}
 % \changes{1.3}{Allow multiple targets per \env{MacroCode}}
 % \changes{1.3b}{Use \pkg{sourcecodepro} instead of \pkg{inconsolata}. Fix issue with index entries of different types with same name}
+% \changes{1.4}{Added option to control \pkg{babel}. Allow optional default value arguments in \env{macro} and friends. Fix spacing issue in \env{option} and friends}
+% \iffalse
+%%% Don't forget to update the version number and release date of
+%%% the package declaration on line 76!
+% \fi
 %
 % \package[ctan=skdoc,vcs=https://github.com/urdh/skdoc]{skdoc}
 % \repository{https://github.com/urdh/skdoc}
@@ -220,6 +225,11 @@
 % unless the documentation describes a very large package, and the
 % repeated calls to \texttt{pygmentize} take too long.
 %
+% \Option{babel}
+% The \opt{babel} option allows you to specify what languages are loaded
+% by the \pkg{babel} package. It is a key-value option, and its content
+% is passed as options to the \pkg{babel} \cs*{usepackage} declaration.
+%
 % \subsection{General macros}
 % The document class defines a number of general macros intended for
 % use in parts of the document not strictly considered
@@ -600,16 +610,16 @@
 % improve readability of the implementation code.
 %
 % \DescribeEnv[<description>]{macro}{<\textbackslash macro>}
-%                     [<\# of args>]{<arg 1 description>}'...'
-%                                   {<arg n description>}
+%                     [<\# of args>]{<arg 1 description>}[<default value>]'...'
+%                                   {<arg n description>}[<default value>]
 % With this environment, the implementation of a macro is described.
 % Note that as with \cs{DescribeMacro}, \LaTeX3-style macros can not
 % be used in \meta{\textbackslash macro} without the catcode hack
 % mentioned earlier.
 %
 % \DescribeEnv[<description>]{environment}{<environment>}
-%                     [<\# of args>]{<arg 1 description>}'...'
-%                                   {<arg n description>}
+%                     [<\# of args>]{<arg 1 description>}[<default value>]'...'
+%                                   {<arg n description>}[<default value>]
 % This environment describes the implementation of an environment.
 %
 % \DescribeEnv[<description>]{option}{<option>}
@@ -771,13 +781,15 @@
 %    \end{macrocode}
 % The rest is basically just styling.
 %    \begin{macrocode}
-\RequirePackage[british]{babel}
-\RequirePackage[english=british]{csquotes}
-\RequirePackage[font=small,labelfont=bf,textfont=it]{caption}
-\RequirePackage{scrpage2,PTSerif}
-\usepackage{sourcecodepro}
-\RequirePackage[defaultsans,osfigures,scale=0.95]{opensans}
-\RequirePackage[babel]{microtype}
+\RequirePackage{scrpage2}
+\AtEndOfClass{%
+    \RequirePackage[\skdoc@babel]{babel}
+    \RequirePackage[english=british]{csquotes}
+    \RequirePackage[font=small,labelfont=bf,textfont=it]{caption}
+    \RequirePackage{PTSerif,sourcecodepro}
+    \RequirePackage[defaultsans,osfigures,scale=0.95]{opensans}
+    \RequirePackage[babel]{microtype}
+}
 %    \end{macrocode}
 %
 % \subsection{Error messages}
@@ -882,6 +894,7 @@
     prefix=skdoc@
 }
 \DeclareStringOption{load}[\jobname]
+\DeclareStringOption[british]{babel}
 \DeclareBoolOption[true]{highlight}
 \ProcessKeyvalOptions*
 %    \end{macrocode}
@@ -2031,7 +2044,7 @@
     }%
 }{
     \let\skdoc@macroname@key\@empty
-    \IfBooleanTF{#1}{}{\@esphack}
+    \IfBooleanTF{#1}{}{\par\@esphack}
 }
 %    \end{macrocode}
 % \end{environment}
@@ -2059,7 +2072,7 @@
     }%
 }{
     \let\skdoc@macroname@key\@empty
-    \IfBooleanTF{#1}{}{\@esphack}
+    \IfBooleanTF{#1}{}{\par\@esphack}
 }
 %    \end{macrocode}
 % \end{environment}
@@ -2073,6 +2086,7 @@
     \index@option!{#2}
     \@optionname{#2}%
     \IfBooleanTF{#1}{}{
+        \vspace{\baselineskip}
         \PrintEnvImplName{#2}
         \IfNoValueTF{#3}{
             \macro@impl@argline@noarg{(option)}
@@ -2084,7 +2098,7 @@
     }%
 }{
     \let\skdoc@macroname@key\@empty
-    \IfBooleanTF{#1}{}{\@esphack}
+    \IfBooleanTF{#1}{}{\par\@esphack}
 }
 %    \end{macrocode}
 % \end{environment}
@@ -2097,12 +2111,13 @@
     \index@bibentry!{\expandafter\@gobble\string#2}
     \@bibentryname{#2}%
     \IfBooleanTF{#1}{}{
+        \vspace{\baselineskip}
         \PrintEnvImplName{#2}
         \macro@impl@argline@noarg{(\hologoRobust{BibTeX}~entry~type)}
     }%
 }{
     \let\skdoc@macroname@key\@empty
-    \IfBooleanTF{#1}{}{\@esphack}
+    \IfBooleanTF{#1}{}{\par\@esphack}
 }
 %    \end{macrocode}
 % \end{environment}
@@ -2115,12 +2130,13 @@
     \index@theme!{#2}
     \@themename{#2}%
     \IfBooleanTF{#1}{}{
+        \vspace{\baselineskip}
         \PrintEnvImplName{#2}
         \macro@impl@argline@noarg{(theme)}
     }%
 }{
     \let\skdoc@macroname@key\@empty
-    \IfBooleanTF{#1}{}{\@esphack}
+    \IfBooleanTF{#1}{}{\par\@esphack}
 }
 %    \end{macrocode}
 % \end{environment}
@@ -2231,6 +2247,41 @@
 }
 %    \end{macrocode}
 % \end{macro*}
+% \begin{macro*}{\macro@impl@arg@noopt}
+%    \begin{macrocode}
+\def\macro@impl@arg@noopt#1{%
+    \macro@impl@argline{\the\macro@impl@curarg}{#1}
+    \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax
+        \expandafter\macro@impl@arg
+    \else
+        \expandafter\macro@impl@endargs
+    \fi
+}
+%    \end{macrocode}
+% \end{macro*}
+% \begin{macro*}{\macro@impl@arg@opt}
+%    \begin{macrocode}
+\def\macro@impl@arg@opt#1[#2]{%
+    \macro@impl@argline{\the\macro@impl@curarg}
+        {#1\hfill\AndDefault{#1}\vspace{-\baselineskip}}
+    \ifnum\macro@impl@curarg<\macro@impl@argcnt\relax
+        \expandafter\macro@impl@arg
+    \else
+        \expandafter\macro@impl@endargs
+    \fi
+}
+%    \end{macrocode}
+% \end{macro*}
+% \begin{macro*}{\macro@impl@arg}
+%    \begin{macrocode}
+\def\macro@impl@arg#1{%
+    \advance\macro@impl@curarg by\@ne\relax
+    \@ifnextchar[%]
+        {\macro@impl@arg@opt{#1}}%
+        {\macro@impl@arg@noopt{#1}}%
+}
+%    \end{macrocode}
+% \end{macro*}
 % \begin{macro*}{\macro@impl@endargs}
 % \changes{1.3b}{Conditionally don't add space if another environment follows}
 %    \begin{macrocode}
@@ -3198,8 +3249,10 @@
 % Set up microtype properly
 %    \begin{macrocode}
 \g@addto@macro\@verbatim{\microtypesetup{activate=false}}
-\microtypesetup{expansion,kerning,spacing,tracking}
-\DisableLigatures{family = tt*}
+\AtEndOfClass{%
+    \microtypesetup{expansion,kerning,spacing,tracking}%
+    \DisableLigatures{family = tt*}%
+}
 %    \end{macrocode}
 % We also want numbers on the bibliography headings, if we are loading
 % \pkg{biblatex}. If we happen to be loading \pkg{bibtex}, we issue a
-- 
cgit v1.2.3

