Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix plugin related docs and logs #10029

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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