summaryrefslogtreecommitdiff
path: root/macros/generic/memoize/doc/memoize-code.tex
blob: 6daa583383f68917137686df37c00a294adf562d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
\documentclass[a4paper,11pt]{ltxdoc}

\usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm,
  marginparwidth=0cm,marginparsep=0pt,
  nohead,includefoot
]{geometry}
\settowidth\marginparsep{\ }

% There is a \mmzset in memoize-doc-common.
\usepackage{nomemoize}

% Hypdoc (which loads hyperref) must be loaded before memoize-code.
\usepackage{hypdoc}
\hypersetup{colorlinks=true, allcolors=blue}

\usepackage{memoize-code} % Also loads memoize-doc-common

\pdfsystem{makeindex -s gind.ist \jobname.idx}

\CodelineIndex
\EnableCrossrefs

\title{The documented source of Memoize, Advice and CollArgs}
\author{Sašo Živanović\\[2mm]
  \emailsymbol~\url(mailto:){saso.zivanovic@guest.arnes.si}\\
  \homepagesymbol~\url(http://){spj.ff.uni-lj.si/zivanovic}\\
  \faGithub~\url(https://){github.com/sasozivanovic}}

\datefrompackageversion{collargs}
\edef\allpackagever{CollArgs v\packagever}
\datefrompackageversion{advice}
\epreto\allpackagever{Advice v\packagever, }
\datefrompackageversion{memoize}
\epreto\allpackagever{Memoize v\packagever, }
\let\packagever\allpackagever

\hypersetup{
  % pdftitle={Memoize},
  pdfauthor={Sašo Živanović},
  pdfsubject={externalization},
  pdfkeywords={LaTeX, externalization, memoization}
}

\begin{document}

\maketitle

\def\docdir{..}
\DocInput{\docdir/memoize.dtx}

\section{Auxiliary packages}
\label{sec:code:utils}

\subsection{Extending commands and environments with Advice}
\label{sec:code:auto}

\DocInput{\docdir/advice.dtx}

\subsection{Argument collection with CollArgs}
\label{sec:code:collargs}

\DocInput{\docdir/collargs.dtx}

\clearpage
\restoregeometry

\section{The scripts}
\label{sec:code:scripts}

\def\continuation{\llap{\textcolor{purple}{$\rightarrow$}\,}}

\subsection{The Perl extraction script \texttt{memoize-extract.pl}}

\lstinputlisting[firstline=20, % manual (exclude the license information)
  language=Perl,
  breaklines, breakindent=4em, postbreak=\continuation,
  commentstyle=,
]{../memoize-extract.pl}

\subsection{The Python extraction script \texttt{memoize-extract.py}}

\lstinputlisting[firstline=20, % manual (exclude the license information)
  language=Python,
  breaklines, breakindent=4em, postbreak=\continuation,
  commentstyle=,
]{../memoize-extract.py}

\subsection{The Perl clean-up script \texttt{memoize-clean.pl}}

\lstinputlisting[firstline=20, % manual (exclude the license information)
  language=Perl,
  breaklines, breakindent=4em, postbreak=\continuation,
  commentstyle=,
]{../memoize-clean.pl}

\subsection{The Python clean-up script \texttt{memoize-clean.py}}

\lstinputlisting[firstline=20, % manual (exclude the license information)
  language=Python,
  breaklines, breakindent=4em, postbreak=\continuation,
  commentstyle=,
]{../memoize-clean.py}

\clearpage

\IndexPrologue{\section*{Index}Numbers written in red refer to the code line
  where the corresponding entry is defined; numbers in blue refer to the code
  lines where the entry is used.}

\setcounter{IndexColumns}{2}
\def\main#1{\begingroup\hypercolor{link}{red}#1\endgroup}
\PrintIndex

\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-engine: luatex
%%% TeX-master: t
%%% End: