Skip to content

Commit 5a5984a

Browse files
authored
Merge branch 'main' into fix-output-folder-paths
2 parents 0051a98 + 5ed62db commit 5a5984a

File tree

255 files changed

+3502
-3216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+3502
-3216
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
.xrefmap.json filter=lfs diff=lfs merge=lfs -text
55
# Use LF for templates files.
66
templates/** eol=lf
7+
8+
# VerifyTests
9+
*.verified.txt text eol=lf working-tree-encoding=UTF-8

.github/actions/build/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ runs:
2020
shell: bash
2121
working-directory: templates
2222

23-
- run: dotnet build -c Release --warnAsError
23+
- run: dotnet build -c Release --warnAsError --maxcpucount
2424
shell: bash

.github/codeql-config.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
shell: bash
3232
working-directory: templates
3333

34-
- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage"
34+
- run: dotnet test -c Release -f net8.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:Summary;Verbosity=Minimal
3535

36-
- run: dotnet test -c Release -f net6.0 --no-build --collect:"XPlat Code Coverage"
36+
- run: dotnet test -c Release -f net6.0 --no-build --collect:"XPlat Code Coverage" --consoleLoggerParameters:Summary;Verbosity=Minimal
3737
if: matrix.os == 'ubuntu-latest'
3838

3939
- run: npm i -g @percy/cli
@@ -44,9 +44,6 @@ jobs:
4444
env:
4545
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
4646

47-
- uses: codecov/codecov-action@v4
48-
if: matrix.os == 'ubuntu-latest'
49-
5047
- run: echo "DOTNET_DbgEnableMiniDump=1" >> $GITHUB_ENV
5148
if: matrix.os == 'ubuntu-latest'
5249

.github/workflows/codeql.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616

1717
- name: dotnet publish
1818
run: |
19-
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r win-x64 -o drop/publish/win-x64 /p:PlaywrightPlatform=win
20-
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r linux-x64 -o drop/publish/linux-x64 /p:PlaywrightPlatform=linux
21-
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64 /p:PlaywrightPlatform=osx
19+
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r win-x64 -o drop/publish/win-x64
20+
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r linux-x64 -o drop/publish/linux-x64
21+
dotnet publish src/docfx -f net8.0 -c Release /p:Version=${GITHUB_REF_NAME#v} --self-contained -r osx-x64 -o drop/publish/osx-x64
2222
mkdir -p drop/bin
2323
2424
- run: zip -r ../../bin/docfx-win-x64-${GITHUB_REF_NAME}.zip .

.github/workflows/snapshot.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow update snapshot.
2+
name: snapshot
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryrun:
7+
type: boolean
8+
description: Set `true` to skip commit diffs.
9+
default: true
10+
11+
jobs:
12+
snapshot:
13+
runs-on: ubuntu-latest
14+
environment: ci
15+
strategy:
16+
fail-fast: false
17+
permissions:
18+
actions: write # Required to invoke another workflow with `createWorkflowDispatch`.
19+
contents: write # Required to commit snapshot diffs.
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.ref_name }}
24+
lfs: true
25+
26+
# Build projects
27+
- uses: ./.github/actions/build
28+
29+
# Update snapshots & accept changes
30+
- run: dotnet test -c Release -f net8.0 --no-build --filter Stage=Snapshot
31+
working-directory: test/docfx.Snapshot.Tests
32+
env:
33+
BUILD_SERVER: false # Need to accept file changes automatically.
34+
35+
# Show diff file names (It's required when using dryrun option)
36+
- name: Show diff file names
37+
run: |
38+
git diff --name-only
39+
40+
# Commit updated snapshot contents
41+
- uses: stefanzweifel/git-auto-commit-action@v5
42+
id: auto-commit-action
43+
if: ${{ github.event.inputs.dryrun == 'false'}}
44+
with:
45+
commit_message: 'test(snapshot): update snapshots ${{ github.sha }}'
46+
47+
# Invoke CI workflow if changes are committed.
48+
- uses: actions/github-script@v7
49+
if: ${{ steps.auto-commit-action.outputs.changes_detected == 'true' }}
50+
with:
51+
script: |
52+
try {
53+
await github.rest.actions.createWorkflowDispatch({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
workflow_id: 'ci.yml',
57+
ref: '${{ github.ref_name }}',
58+
})
59+
}
60+
catch(error) {
61+
console.error(error)
62+
core.setFailed(error)
63+
}

Directory.Build.props

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\"/>
4646
</ItemGroup>
4747

48-
<ItemGroup>
48+
<ItemGroup Condition="'$(ProjectName)' != 'Docfx.Common'">
4949
<PackageReference Include="PolySharp">
5050
<PrivateAssets>all</PrivateAssets>
5151
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
@@ -59,4 +59,12 @@
5959
</PackageReference>
6060
</ItemGroup>
6161

62+
63+
<!-- Remove Node.js runtime dependencies that used by playwright -->
64+
<Target Name="RemoveNodeJsRuntimes" AfterTargets="CopyPlaywrightFilesToOutput">
65+
<ItemGroup>
66+
<Content Remove="@(Content)" Condition="$([System.String]::Copy('%(Content.PlaywrightFolder)').Contains('node\'))" />
67+
</ItemGroup>
68+
</Target>
69+
6270
</Project>

Directory.Packages.props

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
<Project>
2-
<!-- See https://learn.microsoft.com/nuget/consume-packages/Central-Package-Management -->
3-
<PropertyGroup>
4-
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5-
</PropertyGroup>
6-
<ItemGroup>
7-
<PackageVersion Include="HtmlAgilityPack" Version="1.11.61" />
8-
<PackageVersion Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
9-
<PackageVersion Include="IgnoresAccessChecksToGenerator" Version="0.7.0" />
10-
<PackageVersion Include="Jint" Version="3.1.2" />
11-
<PackageVersion Include="JsonSchema.Net" Version="7.0.2" />
12-
<PackageVersion Include="Markdig" Version="0.37.0" />
13-
<PackageVersion Include="Microsoft.Playwright" Version="1.44.0" />
14-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
15-
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
16-
<PackageVersion Include="OneOf" Version="3.0.271" />
17-
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.271" />
18-
<PackageVersion Include="PdfPig" Version="0.1.9-alpha-20240530-d7e43" />
19-
<PackageVersion Include="PlantUml.Net" Version="1.4.80" />
20-
<PackageVersion Include="PolySharp" Version="1.14.1" />
21-
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
22-
<PackageVersion Include="Spectre.Console.Cli" Version="0.49.1" />
23-
<PackageVersion Include="Stubble.Core" Version="1.10.8" />
24-
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
25-
<PackageVersion Include="System.Composition" Version="8.0.0" />
26-
<PackageVersion Include="YamlDotNet" Version="15.1.6" />
27-
</ItemGroup>
28-
29-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
30-
<!-- "17.3.2" is the latest compatible version for .NET 6 -->
31-
<PackageVersion Include="Microsoft.Build" Version="[17.3.2]" />
32-
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
33-
<PackageVersion Include="Microsoft.CodeAnalysis" Version="[4.8.0]" />
34-
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="[4.8.0]" />
35-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.8.0]" />
36-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="[4.8.0]" />
37-
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="[4.8.0]" />
38-
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="[4.8.0]" />
39-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="[4.8.0]" />
40-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="[4.8.0]" />
41-
</ItemGroup>
42-
43-
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
44-
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.9.2" />
45-
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
46-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
47-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
48-
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.9.2" />
49-
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.9.2" />
50-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.9.2" />
51-
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.9.2" />
52-
</ItemGroup>
53-
54-
<ItemGroup>
55-
<!-- Test only -->
56-
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
57-
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
58-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
59-
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
60-
<PackageVersion Include="Verify.DiffPlex" Version="2.3.0" />
61-
<PackageVersion Include="Verify.Xunit" Version="24.2.0" />
62-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
63-
<PackageVersion Include="xunit" Version="2.8.1" />
64-
</ItemGroup>
65-
</Project>
1+
<Project>
2+
<!-- See https://learn.microsoft.com/nuget/consume-packages/Central-Package-Management -->
3+
<PropertyGroup>
4+
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageVersion Include="HtmlAgilityPack" Version="1.11.61" />
8+
<PackageVersion Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
9+
<PackageVersion Include="IgnoresAccessChecksToGenerator" Version="0.7.0" />
10+
<PackageVersion Include="Jint" Version="3.1.4" />
11+
<PackageVersion Include="JsonSchema.Net" Version="7.1.2" />
12+
<PackageVersion Include="Markdig" Version="0.37.0" />
13+
<PackageVersion Include="Microsoft.Playwright" Version="1.45.0" />
14+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
15+
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
16+
<PackageVersion Include="OneOf" Version="3.0.271" />
17+
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.271" />
18+
<PackageVersion Include="PdfPig" Version="0.1.9-alpha-20240702-65c64" />
19+
<PackageVersion Include="PlantUml.Net" Version="1.4.80" />
20+
<PackageVersion Include="PolySharp" Version="1.14.1" />
21+
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
22+
<PackageVersion Include="Spectre.Console.Cli" Version="0.49.1" />
23+
<PackageVersion Include="Stubble.Core" Version="1.10.8" />
24+
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />
25+
<PackageVersion Include="System.Composition" Version="8.0.0" />
26+
<PackageVersion Include="YamlDotNet" Version="15.3.0" />
27+
</ItemGroup>
28+
29+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
30+
<!-- "17.3.2" is the latest compatible version for .NET 6 -->
31+
<PackageVersion Include="Microsoft.Build" Version="[17.3.2]" />
32+
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
33+
<PackageVersion Include="Microsoft.CodeAnalysis" Version="[4.8.0]" />
34+
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="[4.8.0]" />
35+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="[4.8.0]" />
36+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="[4.8.0]" />
37+
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="[4.8.0]" />
38+
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="[4.8.0]" />
39+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="[4.8.0]" />
40+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="[4.8.0]" />
41+
</ItemGroup>
42+
43+
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
44+
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.10.0" />
45+
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.10.0" />
46+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
47+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
48+
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.10.0" />
49+
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic" Version="4.10.0" />
50+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.10.0" />
51+
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.10.0" />
52+
</ItemGroup>
53+
54+
<ItemGroup>
55+
<!-- Test only -->
56+
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
57+
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
58+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
59+
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
60+
<PackageVersion Include="Verify.DiffPlex" Version="3.1.0" />
61+
<PackageVersion Include="Verify.Xunit" Version="25.3.0" />
62+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
63+
<PackageVersion Include="xunit" Version="2.9.0" />
64+
</ItemGroup>
65+
</Project>

Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,31 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim
33
# Add dotnet tools to path.
44
ENV PATH="${PATH}:/root/.dotnet/tools"
55

6+
# Set target docfx version.
7+
ARG DOCFX_VERSION=2.77.0
8+
69
# Install DocFX as a dotnet tool.
7-
RUN dotnet tool update -g docfx && \
8-
docfx --version
10+
RUN dotnet tool install docfx -g --version ${DOCFX_VERSION} && \
11+
docfx --version && \
12+
rm -f /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/docfx.nupkg && \
13+
rm -f /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/docfx.${DOCFX_VERSION}.nupkg && \
14+
rm -rf /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net6.0
915

10-
# Install dependences for chromium PDF.
16+
# Install Node.js and dependences for chromium PDF.
1117
RUN apt-get update -qq && \
1218
apt-get install -y -qq --no-install-recommends \
19+
nodejs \
1320
libglib2.0-0 libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
1421
libdbus-1-3 libxcb1 libxkbcommon0 libatspi2.0-0 libx11-6 libxcomposite1 libxdamage1 \
1522
libxext6 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2 && \
1623
rm -rf /var/lib/apt/lists/* /tmp/*
1724

25+
# Install Chromium.
26+
RUN PLAYWRIGHT_NODEJS_PATH="/usr/bin/node" && \
27+
ln -s /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/.playwright /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/.playwright && \
28+
pwsh -File /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/playwright.ps1 install chromium && \
29+
unlink /root/.dotnet/tools/.store/docfx/${DOCFX_VERSION}/docfx/${DOCFX_VERSION}/tools/net8.0/any/.playwright
30+
1831
WORKDIR /opt/prj
1932
VOLUME [ "/opt/prj" ]
2033

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ jobs:
9898
You can also use docfx as a NuGet library:
9999
100100
```xml
101-
<PackageReference Include="Docfx.App" Version="2.73.2" />
101+
<PackageReference Include="Docfx.App" Version="2.76.0" />
102+
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.9.2" />
103+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
102104
```
103105

104106
Then build a docset using:

docs/reference/docfx-cli-reference/docfx-metadata.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,19 @@ Run `docfx metadata --help` or `docfx -h` to get a list of all available options
9595
- `SeparatePages`
9696
- Place members in separate pages.
9797

98+
- **--useClrTypeNames**
99+
100+
Indicates whether the CLR type names or the language aliases must be used.
101+
102+
- not specified or `false`
103+
- The language aliases are used: `int`.
104+
- `true`
105+
- The CLR type names are used: `Int32`.
106+
98107
## Examples
99108

100109
- Generate YAML files with default config.
101110

102111
```pwsh
103112
docfx metadata
104113
```
105-

docs/reference/docfx-environment-variables-reference.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ This setting is intended to be used on offline environment.
2626

2727
## `DOCFX_PDF_TIMEOUT`
2828

29-
Maximum time in milliseconds to override the default [Playwright timeout](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) for PDF generation.
29+
Maximum time in milliseconds to override the default [Playwright timeout](https://playwright.dev/docs/api/class-browsercontext#browser-context-set-default-timeout) for PDF generation.
30+
31+
## `PLAYWRIGHT_NODEJS_PATH`
32+
33+
Custom Node.js executable path that will be used by the `docfx pdf' command.
34+
By default, docfx automatically detect installed Node.js from `PATH`.

0 commit comments

Comments
 (0)