As I'm currently writing a package and started to use dtx format I wondered if there are alternative classes just using doc, so I started to use l3doc (since I use expl3 syntax). I'm pretty satisfied with it, but the following points are some kind of annoying:
- I'm using
variableto describe variables andmacroto describe macros (sincefunctionshould be used in documentation not in code). How can I unify the styles of both (either with or without the bars in the margin, I'd rather like to have them)? - Is it possible to transfer this look to the layout achieved with
\DescribeEnv(bars too)? - How should I markup Lua code, which is used by the package? Should I use
\NewMacroEnvironmentas thel3docdocumentation states?
This question is not about:
- Changing the documentclass of
ltxdocor - switching to another class, which breaks
docfunctionality, but could eventually be used for documentation.
What I actually use and am unsatisfied with (sample dtx file, I have removed package call to avoid providing .ins file):
% \iffalse meta-comment
%<package>\RequirePackage{expl3}
%<package>\RequirePackage{xparse}
%<package>\ProvidesExplPackage{testpack}{2017/04/15}{0.1}{Test package}
%<*driver>
\documentclass{l3doc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{testpack.dtx}
\end{document}
%</driver>
% \fi
%
% \begin{documentation}
% \GetFileInfo{testpack.sty}
%
% \title{The \texttt{testpack} package\thanks{This document corresponds to \texttt{termdoc}~\fileversion, dated~\filedate.}}
% \author{TeXnician}
% \date{\today}
% \maketitle
% \tableofcontents
%
% \section{User interface}
% \DescribeMacro{\justdoit} My test \cs{justdoit}: here would be the function call
% \begin{function}{\justdoit}
% \begin{syntax}
|\justdoit|
% \end{syntax}
% \meta{description}
% \end{function}
% \end{documentation}
% \begin{implementation}
% \section{Implementation}
%<*package>
% \begin{macrocode}
\RequirePackage{iftex}
\RequireLuaTeX
\RequirePackage{luacode}
% \end{macrocode}
% \begin{variable}{\mytl}
% A variable
% \begin{macrocode}
\tl_new:N \mytl
% \end{macrocode}
% \end{variable}
% \begin{environment}{luacode}
% \begin{macrocode}
\begin{luacode}
function justdoit()
tex.print(1,[[Test]])
end
\end{luacode}
% \end{macrocode}
% \end{environment}
% \begin{macro}{\justdoit}
% \begin{macrocode}
\NewDocumentCommand{\justdoit}{}{
\directlua{justdoit()}
}
% \end{macrocode}
% \end{macro}
%</package>
% \end{implementation}
% \Finale
\endinput
Update: Here's an example output:
