I am using l3doc and DocStrip more and more these days.
Also, I am using more and more LaTeX3 and love the ability, to give the variables and functions readable and meaningfull names. Added with scope and type info, the names tend to be much longer than before.
Actually, I am writing a .dtx file, which contains in fact three (or more) packages. I am using the @@ to give variables and functions a module related name also, which make the names even longer.
When processing the file through LaTeX to generate the documentation, in all code examples, the @@ will be replaced with the last module name mentioned, which is in this case tuc_m_k_calc.
% \begin{macrocode}
%<*label>
%@@=tuc_m_k_label>
%</label>
%<*concept>
%<@@=tuc_m_k_concept>
%</concept>
%<*calc>
%<@@=tuc_m_k_calc>
%</calc>
% \end{macrocode}
Therefore, the implementation will show something like this:
\bool_new:N \l_@@_opt_draft_bool
but will be typeset as
\bool_new:N \l_tuc_m_k_calc_opt_draft_bool
This string will be printed into the margin note and the index as well, ignoring the fact, that its sibblings \l_tuc_m_k_concept_opt_draft_bool and \l_tuc_m_k_label_opt_draft_bool are meant and described as well.
I was wondering, if instead printing \l_@@_opt_draft_bool into the documentation wouldn't be a better solution. Obviously, it is space efficient and economic. It is fair, as all three variants are easily met with this description as well. I think, it is even easier to read and understand, as the fully expanded name. (In fact, when fixing bugs, I often wish, LaTeX would reverse the name to the original code, making it more easier for me, to spot the place in the .dtx files.)
This result could easily be achieved, by using this instead of the above mentioned code:
% \iffalse
% \begin{macrocode}
%<*label>
%@@=tuc_m_k_label>
%</label>
%<*concept>
%<@@=tuc_m_k_concept>
%</concept>
%<*calc>
%<@@=tuc_m_k_calc>
%</calc>
% \end{macrocode}
% \fi
This would make the documentation more readable (in my eyes).
Do you think, this is a good idea? Are there any sideeffects, I haven't thought of? If you recommend this style, what would be the best way to implement it?
docstripdoes not print anything.docstripis the tool to unpackdtxfiles. What will be printed in the documentation depends on the classes and packages used for documentation, e.g., packagedoc. So please show a minimal working example, that also shows the used documentation class/packages. – cabohah Feb 15 '24 at 12:53l3docis meant here – Joseph Wright Feb 15 '24 at 12:59tucand submodule is e.g.label, what ism_kabout?) – Joseph Wright Feb 15 '24 at 13:01l3docis meant. The question does nowhere refer tol3doc, neither in the title nor the tags, nor the text of the question. And an example that would help to make this clear is also missing. – cabohah Feb 15 '24 at 13:17m_kpart, which is not recommended and confusing. The.styorclsshould be left as is, as well as the.pdfdocumentation file. The .dtxfile as you say looks different and difficult to search. Maybe either with the editor or a Lua script can be transformed and get rid of the @@ altogether? there is no particular reason to have them. It is just convenience. I agree with you compactness should be sought. See https://tex.stackexchange.com/questions/698540/how-can-i-improve-the-coloring-of-macrocode-envronments – yannisl Feb 15 '24 at 14:17