I refer to the solution that was presented in multiple indexes in ltxdoc When I add some lines, it doesn't work anymore. I have the feeling that something deeper is wrong, but for a start consider this MWE.
1) The option nonewpage results in no index printed at all (delete the temp files first if they are already there, otherwise you won't notice this).
2) The "other" index contains the entry: Test String A , Test String A 1
To me it seems that the imakeidx package and the original indexing in the doc package have some communication problems.
\documentclass{ltxdoc}
% with option nonewpage no indexes are printed
%\usepackage[nonewpage]{imakeidx}
\usepackage{imakeidx}
\CodelineIndex\EnableCrossrefs
\indexsetup{level=\section*}
\makeindex[name=other]
\makeindex[options=-s gind.ist,title={General Index}]
\begin{document}
\DescribeMacro{\mymacroA}
\DescribeMacro{\mymacroB}\index[other]{\mymacroB}
\def\mymacroA{Test String A}
\def\mymacroB#1{%
\mymacroA\
#1
\mymacroA
}multiple indexes in ltxdoc
%
\newpage
\mymacroB{Test String B}
\printindex
\printindex[other]
\end{document}
nonewpage
you must run MakeIndex separately. – egreg Feb 3 '18 at 12:15other
index contains\item \mymacroB, 1
; you need to stringify it. – egreg Feb 3 '18 at 18:17