I have successfully integrated DocFx with a Visual Studio project, using docfx.console, as described here and here.
Under this setup, the building of the project triggers DocFx to process the docfx.json and markdown files found under the project. I do not directly execute docfx.exe. This works both when building the project manually in Visual Studio, and when building on a build server.
I am using the default DocFx template (there is no extracted template in my project) and docfx.console 2.48.1 (the latest as of now).
I am now trying to integrate a custom DocFx plugin & post processor. I have taken two samples from Github (RtfDocumentProcessor & DocFx.Plugin.LastModified) and created a new .NET Framework 4.7.2 class library, which builds OK.
The problem is how to modify the docfx.json to tell DocFx to use the plugin & post processor. The above articles assume docfx.exe is run directly, and also that there is a "template" folder, for example:
- Build our project.
- Copy the output dll files to:
- Global: the folder with name Plugins under DocFX.exe
- Non-global: the folder with name Plugins under a template folder. Then run DocFX build command with parameter -t {template}.
I have tried putting my class library DLL in many different folders, and tried modifying the "template" and "postProcessors" settings in docfx.json, but in every case the build fails with a message like this (this is complaining about the DocFx.Plugin.LastModified post processor, which I tried running by setting: "postProcessors": [ "ExtractSearchIndex", "LastModifiedPostProcessor" ]):
Warning:[BuildCommand]Can't import: LastModifiedPostProcessor, System.Composition.Hosting.CompositionFailedException: No export was found for the contract 'IPostProcessor "LastModifiedPostProcessor"'.
Does anyone have instructions on how to get this to work with docfx.console?