dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
3.94k stars 840 forks source link

Ensure BuildOptions can configure the output directory instead of forcing inline rendering #9986

Open rmannibucau opened 1 month ago

rmannibucau commented 1 month ago

@dotnet-policy-service agree

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.86%. Comparing base (fe673ec) to head (f89ff73). Report is 191 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9986 +/- ## ========================================== + Coverage 74.31% 78.86% +4.54% ========================================== Files 536 540 +4 Lines 23189 23468 +279 Branches 4056 4065 +9 ========================================== + Hits 17234 18508 +1274 + Misses 4853 3820 -1033 - Partials 1102 1140 +38 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

filzrev commented 1 month ago

BuildJsonConfig has Output property that can be used to change output directory by setting this property.

https://github.com/dotnet/docfx/blob/4f6f77945758ceb9d706b25dc33b04dabdbc6180/src/Docfx.App/Config/BuildJsonConfig.cs#L54-L60

Is there any missing features that can not be covered above solution?


Note: There is following behavior differences. So it might need to explicitly set full path.

rmannibucau commented 1 month ago

Hi

One issue is the configuration is internal so programmatically it would require to generate a json file, I'd prefer something closer to docfx project api if possible.

filzrev commented 4 weeks ago

One issue is the configuration is internal

I've forgotten that BuildJsonConfig can't access programmatically because it's declared as internal. I've requested to change these options to public before at #8872. But currently there is no progress.

As a temporary workaround. By using IgnoresAccessChecksToGenerator. It can use RunBuild.Exec method directly instead of Docset.Build API.

Example configs of csproj

  <ItemGroup>
    <PackageReference Include="IgnoresAccessChecksToGenerator" Version="0.7.0" PrivateAssets="All" />
    <InternalsAssemblyName Include="Docfx.App" />
    <InternalsAssemblyName Include="Docfx.Dotnet" />
  </ItemGroup>
rmannibucau commented 4 weeks ago

@filzrev it would work but does it make sense to not expose what doxfx project uses or should docfx not use this output param anymore then?

rmannibucau commented 1 week ago

guess we can drop this PR is https://github.com/dotnet/docfx/pull/10010 will reach main repo anytime soon, wdyt?