texlive[64986] Master/texmf-dist: docshots (10nov22)
commits+karl at tug.org
commits+karl at tug.org
Thu Nov 10 21:22:22 CET 2022
Revision: 64986
http://tug.org/svn/texlive?view=revision&revision=64986
Author: karl
Date: 2022-11-10 21:22:21 +0100 (Thu, 10 Nov 2022)
Log Message:
-----------
docshots (10nov22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/docshots/README.md
trunk/Master/texmf-dist/doc/latex/docshots/docshots.pdf
trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx
trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty
Modified: trunk/Master/texmf-dist/doc/latex/docshots/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/docshots/README.md 2022-11-10 20:21:57 UTC (rev 64985)
+++ trunk/Master/texmf-dist/doc/latex/docshots/README.md 2022-11-10 20:22:21 UTC (rev 64986)
@@ -28,7 +28,7 @@
\end{document}
```
-Otherwise, you can download [`docshots.sty`](https://raw.githubusercontent.com/objectionary/eolang.sty/gh-pages/docshots/docshots.sty) and add to your project.
+Otherwise, you can download [`docshots.sty`](https://raw.githubusercontent.com/yegor256/docshots/gh-pages/docshots/docshots.sty) and add to your project.
If you want to contribute yourself, make a fork, then create a branch,
then run `l3build ctan` in the root directory.
Modified: trunk/Master/texmf-dist/doc/latex/docshots/docshots.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx 2022-11-10 20:21:57 UTC (rev 64985)
+++ trunk/Master/texmf-dist/source/latex/docshots/docshots.dtx 2022-11-10 20:22:21 UTC (rev 64986)
@@ -50,12 +50,13 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{docshots}
%<*package>
-[2022-10-26 0.2.0 TeX Samples Next to Their PDF Snapshots in DTX]
+[2022-11-10 0.3.0 TeX Samples Next to Their PDF Snapshots in DTX]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[tt=false, type1=true]{libertine}
\usepackage{microtype}
+\AddToHook{env/verbatim/begin}{\microtypesetup{protrusion=false}}
\usepackage[dtx]{docshots}
\usepackage{href-ul}
\usepackage{xcolor}
@@ -96,11 +97,11 @@
% To \href{https://tex.stackexchange.com/questions/661027}{my best}
% knowledge, there were no packages that would allow
% you do exactly this. That's why I created this simple package.
+
% For example, this code:
-%
-%\iffalse
-%<*verb>
-%\fi
+%\iffalse%
+%<*verb>%
+%\fi%
\begin{verbatim}
\begin{docshot}
\documentclass{article}
@@ -155,7 +156,7 @@
% \begin{docshot}
% \documentclass{article}
% \usepackage[paperwidth=2in,
-% paperheight=2.2in]{geometry}
+% paperheight=2.3in]{geometry}
% \begin{document}
% ``There is no sadder thing than
% a young pessimist, except an old
@@ -365,6 +366,26 @@
%</verb>
%\fi
+% \section{Fine-uning Options}
+
+% \DescribeMacro{\docshotOptions}
+% By default, we render the verbatim text using |\VerbatimInput| command with
+% no options. You can add your options using |\docshotOptions| command:
+%\iffalse
+%<*verb>
+%\fi
+\begin{verbatim}
+\docshotOptions{firstline=4}
+\begin{docshot}
+...
+\end{docshot}
+\end{verbatim}
+%\iffalse
+%</verb>
+%\fi
+
+% The options will be cleaned up by the first render of a docshot.
+
% \section{Prerequisites}
% \DescribeMacro{\docshotPrerequisite}
@@ -623,17 +644,21 @@
\begin{minipage}[t]{\docshots at right}%
\vspace{0pt}%
\ifdefined\docshots at lstinputlisting%
- \lstinputlisting{\docshots at tmpdir/\jobname/\hash.tex}%
+ \expandafter\lstinputlisting\expandafter[\docshots at opts]
+ {\docshots at tmpdir/\jobname/\hash.tex}%
\else\ifdefined\docshots at inputminted%
- \inputminted{\docshots at inputminted}
+ \expandafter\inputminted\expandafter[\docshots at opts]
+ {\docshots at inputminted}
{\docshots at tmpdir/\jobname/\hash.tex}%
\else%
- \VerbatimInput{\docshots at tmpdir/\jobname/\hash.tex}%
+ \expandafter\VerbatimInput\expandafter[\docshots at opts]
+ {\docshots at tmpdir/\jobname/\hash.tex}%
\fi\fi%
\vspace{0pt}%
\end{minipage}%
\par%
\endgroup%
+ \docshotOptions{}%
}\makeatother
% \end{macrocode}
% \end{macro}
@@ -661,6 +686,18 @@
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\docshotOptions}
+% Finally, we define |\docshotOptions| command:
+% \changes{0.3.0}{2022/11/10}{New command introduced to help specify custom options for verbatim environments.}
+% \begin{macrocode}
+\makeatletter
+\gdef\docshots at opts{}
+\newcommand\docshotOptions[1]{%
+ \gdef\docshots at opts{#1}%
+}\makeatother
+% \end{macrocode}
+% \end{macro}
+
% \Finale
%\clearpage
Modified: trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty 2022-11-10 20:21:57 UTC (rev 64985)
+++ trunk/Master/texmf-dist/tex/latex/docshots/docshots.sty 2022-11-10 20:22:21 UTC (rev 64986)
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{docshots}
-[2022-10-26 0.2.0 TeX Samples Next to Their PDF Snapshots in DTX]
+[2022-11-10 0.3.0 TeX Samples Next to Their PDF Snapshots in DTX]
@@ -59,6 +59,10 @@
+
+
+
+
\RequirePackage{iexec}
\RequirePackage{fancyvrb}
\RequirePackage{xcolor}
@@ -182,17 +186,21 @@
\begin{minipage}[t]{\docshots at right}%
\vspace{0pt}%
\ifdefined\docshots at lstinputlisting%
- \lstinputlisting{\docshots at tmpdir/\jobname/\hash.tex}%
+ \expandafter\lstinputlisting\expandafter[\docshots at opts]
+ {\docshots at tmpdir/\jobname/\hash.tex}%
\else\ifdefined\docshots at inputminted%
- \inputminted{\docshots at inputminted}
+ \expandafter\inputminted\expandafter[\docshots at opts]
+ {\docshots at inputminted}
{\docshots at tmpdir/\jobname/\hash.tex}%
\else%
- \VerbatimInput{\docshots at tmpdir/\jobname/\hash.tex}%
+ \expandafter\VerbatimInput\expandafter[\docshots at opts]
+ {\docshots at tmpdir/\jobname/\hash.tex}%
\fi\fi%
\vspace{0pt}%
\end{minipage}%
\par%
\endgroup%
+ \docshotOptions{}%
}\makeatother
\makeatletter\newcommand\docshotPrerequisite[1]{
@@ -208,8 +216,14 @@
'\docshots at tmpdir/\jobname/after.sh' created^^J}%
}\makeatother
+\makeatletter
+\gdef\docshots at opts{}
+\newcommand\docshotOptions[1]{%
+ \gdef\docshots at opts{#1}%
+}\makeatother
+
\endinput
%%
%% End of file `docshots.sty'.
More information about the tex-live-commits
mailing list.