From 798ee73838d293b080fc7d65a6a610beaa8c2ebb Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Sat, 22 Jun 2024 12:37:14 +0900 Subject: [PATCH] chore: fix plugin related docs and messages --- docs/tutorial/howto_add_a_customized_post_processor.md | 7 +++---- src/Docfx.App/Helpers/DocumentBuilderWrapper.cs | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/tutorial/howto_add_a_customized_post_processor.md b/docs/tutorial/howto_add_a_customized_post_processor.md index 368af20f986..ce00cc5f77e 100644 --- a/docs/tutorial/howto_add_a_customized_post_processor.md +++ b/docs/tutorial/howto_add_a_customized_post_processor.md @@ -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. @@ -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. diff --git a/src/Docfx.App/Helpers/DocumentBuilderWrapper.cs b/src/Docfx.App/Helpers/DocumentBuilderWrapper.cs index f7bc142b448..b7eb555a8ce 100644 --- a/src/Docfx.App/Helpers/DocumentBuilderWrapper.cs +++ b/src/Docfx.App/Helpers/DocumentBuilderWrapper.cs @@ -47,7 +47,10 @@ private static IEnumerable 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)) {