From f89ff73182ebde0a994857e3a84c6dda1317adff Mon Sep 17 00:00:00 2001 From: Romain Manni-Bucau Date: Tue, 4 Jun 2024 20:36:31 +0200 Subject: [PATCH] Ensure BuildOptions can configure the output directory instead of forcing inline rendering --- src/Docfx.App/BuildOptions.cs | 5 +++++ src/Docfx.App/Docset.cs | 2 +- test/docfx.Tests/Api.verified.cs | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Docfx.App/BuildOptions.cs b/src/Docfx.App/BuildOptions.cs index bff167dab53..1e4d96056c2 100644 --- a/src/Docfx.App/BuildOptions.cs +++ b/src/Docfx.App/BuildOptions.cs @@ -16,4 +16,9 @@ public class BuildOptions /// Configures the markdig markdown pipeline. /// public Func? ConfigureMarkdig { get; init; } + + /// + /// The output directory for the site build, if not set it will be rendered inline. + /// + public string? OutputDirectory { get; init; } } diff --git a/src/Docfx.App/Docset.cs b/src/Docfx.App/Docset.cs index 127e385f66e..e7990c378dc 100644 --- a/src/Docfx.App/Docset.cs +++ b/src/Docfx.App/Docset.cs @@ -32,7 +32,7 @@ public static Task Build(string configPath, BuildOptions options) { return Exec(configPath, (config, configDirectory) => { - RunBuild.Exec(config.build, options, configDirectory); + RunBuild.Exec(config.build, options, configDirectory, options.OutputDirectory); return Task.CompletedTask; }); } diff --git a/test/docfx.Tests/Api.verified.cs b/test/docfx.Tests/Api.verified.cs index 978bdf5a41f..7037ce70dc8 100644 --- a/test/docfx.Tests/Api.verified.cs +++ b/test/docfx.Tests/Api.verified.cs @@ -4,6 +4,7 @@ public class BuildOptions { public BuildOptions() { } public System.Func? ConfigureMarkdig { get; init; } + public string? OutputDirectory { get; init; } } public static class Docset {