Skip to content

Commit

Permalink
chore: Fix plugin related docs and logs (dotnet#10029)
Browse files Browse the repository at this point in the history
chore: fix plugin related docs and messages
  • Loading branch information
filzrev authored and p-kostov committed Jun 28, 2024
1 parent bcafaa3 commit c1ca218
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 3 additions & 4 deletions docs/tutorial/howto_add_a_customized_post_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ In this topic, we will show how to add a customized post-processor.

* Create a new C# class library project in `Visual Studio`.
* Add nuget packages:
* [`System.Collections.Immutable`](https://www.nuget.org/packages/System.Collections.Immutable/1.3.1) with version 1.3.1
* [`Microsoft.Composition`](https://www.nuget.org/packages/Microsoft.Composition/1.0.31) with version 1.0.31
* [`System.Composition`](https://www.nuget.org/packages/System.Composition/8.0.0) with version 8.0.0
* Add `Docfx.Plugins`
If you are building DocFX from source code, add this reference to the project,
otherwise add the nuget package `Docfx.Plugins` with the same version as DocFX.
Expand Down Expand Up @@ -58,8 +57,8 @@ Using `ExtractSearchIndex` for example again, we traverse all HTML files, extrac

## Step4: Build your project and copy the output dll files to:

* Global: the folder with name `Plugins` under the folder containing the Docfx executable
* Non-global: the folder with name `Plugins` under a template folder, then run `DocFX build` command with parameter `-t {template}`.
* Global: the folder that contains the Docfx executable.
* Non-global: the folder with name `plugins` under a template folder, then run `DocFX build` command with parameter `-t {template}`.

*Hint*: DocFX can merge templates, so we can specify multiple template folders as `DocFX build -t {templateForRender},{templateForPlugins}`. Each of the template folders should have a subfolder named `Plugins` with exported assemblies.

Expand Down
5 changes: 4 additions & 1 deletion src/Docfx.App/Helpers/DocumentBuilderWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ private static IEnumerable<Assembly> LoadPluginAssemblies(string pluginDirectory
if (!Directory.Exists(pluginDirectory))
yield break;

Logger.LogInfo($"Searching custom plugins in directory {pluginDirectory}...");
if (pluginDirectory == AppContext.BaseDirectory)
Logger.LogInfo($"Searching built-in plugins in directory {pluginDirectory}...");
else
Logger.LogInfo($"Searching custom plugins in directory {pluginDirectory}...");

foreach (string assemblyFile in Directory.GetFiles(pluginDirectory, "*.dll", SearchOption.TopDirectoryOnly))
{
Expand Down

0 comments on commit c1ca218

Please sign in to comment.