code.sty:
Code: Select all
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{foo}
\usepackage{xparse}
\ExplSyntaxOn
% \end{macrocode}
% Some internal:
% \begin{macro}{NAME}
% \begin{macrocode}
\cs_new:Npn \ewann_impl:n #1 { (#1) }
% \end{macrocode}
% \end{macro}
% \begin{macrocode}
\ExplSyntaxOn
% \end{macrocode}
man.tex:
Code: Select all
\documentclass{ltxdoc}
\usepackage{creatdtx}
\usepackage{amsfonts}
\begin{document}
\title{foo}
\author{erwann}
\maketitle
% \section{Introduction}
%
% The intro
%
%\section{Install}
%
% Copy |THISPACKAGE.sty| to any path looked by the \LaTeX engine.
%
%\section{Usage}
%
%\DescribeMacro{\usepackage}
% \cmd{\usepackage}\oarg{options}|{|\meta{path}|foo}| loads THISPACKAGE
% with options OPTIONS.
%
% \DescribeMacro{\foo}NOINDENT\cs{foo}\marg{arg1}\marg{arg2} does something with ARG1 and ARG2
%
%
\end{document}
From directory foo:
Code: Select all
$ makedtx.pl -author "erwann" -dir src -src "code\.sty=>foo.sty" -doc src/man.tex foo