Need help in customising class ltxdoc.
I would like to colour code macrocode environments so as to facilitate the visual distinction between package's macro code and it associated documentation.
I tried to create a new environment:
\newenvironment{sourcecode}%
{\color{blue}\begin{macrocode}}%
{\end{macrocode}}
That failed with a capacity size exceeded (set for the occasion to 100000).
I had a look at ltxdoc.dtx to see if I could simply import the macrocode environment. But its implementation is too cryptic for me.
Thanks for any insight here :-)

macrocodeenvironment is immediately preceded by with a\DescribeMacro{mymacro}, themymacroin the margin gets coloured too. Adding some documentation text between\DescribeMacro{mymacro}and\begin{macrocode}resolves the colour issue. – JM. Marcastel Dec 06 '17 at 13:48DescribeMacroas well (withpretocmdetc.), for example put\color{black}in front and\color{blue}at the end. – Marijn Dec 06 '17 at 14:23