This issue may be related to some of the existing external document issues, but none of them seem to capture the heart of my concern.
Example Situation
I have a solution with several class libraries and several unit test projects. I'd like to have documentation for all of the libraries, but none of the unit test projects. There are also dependencies between projects. For example, one library may define an interface, and another library may implement that interface using a specific technology.
Running xmldocmd
on specific dlls or looping over them works on the surface but does not generate links between the individual documents generated for each dll.
Trial and error showed me that I could use --external
multiple times on a command line to generate the correct links.
My POC batch file went from something like this:
xmldocmd library1.dll output
xmldocmd library2.dll output
to
FOR %%i IN (library*.dll) DO xmldocmd %%i "output" --external ns1 --external ns2 --external ns3
This made all of my documents and linked them together but also got confused about generics. This may be a separate issue, but when a namespace specified with --external
is found in the assembly being processed, it would try to generate links to a file for the generic type parameter.
Desired Behavior
I realize some of this is a stretch, but here are what I think would be best in order of best to worst.
- Ideally, I could tell it to generate documents for a solution, and it would create documents for all assemblies that create the XML documentation files.
- If I could specify a solution file, the next thing would be to be able to specify a list of assemblies to create XML documents for one line.
- If it was to keep to one assembly per command, like it is now, then it could look for referenced assemblies, in the same folder, and generate links for those assemblies. Assuming that they have XML files.
This option seems like it can get complicated fast since there will be issues if some of the assemblies don't get documents created or get them created in the wrong locations. That is why the previous options are preferred since there is enough context to know which documents are being created and where.
- Another step closer to the current implementation would be to specify
--external
assemblies instead of namespaces and generate links for all of the namespaces in the assembly.
The assumption here is that, if an assembly is specified, then the caller is ensuring that the documents were created for that assembly in the same location.
No matter which option is selected, it would create links between the documents for each assembly as if they were in the same assembly. (Or if you prefer, as if they had the appropriate --external
namespaces defined.)
My Temporary Work Around
As a temporary measure, I have added a command-line program that references the XmlDocMarkdown.Core (2.02)
NuGet package.
It does the following.
- "Selects" all of the assemblies, created by my solution, that created XML documents.
- Reflects over each selected assembly and creates a map of assemblies and namespaces.
- Runs
XmlDocMarkdownGenerator.Generate
for each assembly, with the XmlDocMarkdownSettings.ExternalDocs
set to a distinct list of the namespaces for all of the assemblies except the current one.
- This is to avoid the issue with the generics mentioned above.
Side Note
--external
option is not part of the help displayed when executing the command, I found it on the site, and it wasn't at all clear how to specify more than one namespace.
--external : Generates links to external documentation for the specified namespace.