Skip to content

Commit f822029

Browse files
authored
Merge branch 'main' into chore-add-support-for-forked-repository
2 parents ac2a6a9 + 0699543 commit f822029

File tree

16 files changed

+428
-342
lines changed

16 files changed

+428
-342
lines changed

.github/workflows/nightly.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: nightly
2+
on:
3+
schedule:
4+
- cron: '0 0 * * *'
5+
6+
jobs:
7+
publish-github-packages:
8+
if: github.ref == 'refs/heads/main'
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- id: version
18+
uses: paulhatch/semantic-version@v5.4.0
19+
with:
20+
version_format: ${major}.${minor}.${patch}-preview.${increment}
21+
22+
- uses: ./.github/actions/build
23+
24+
- name: dotnet pack
25+
run: dotnet pack -c Release /p:Version=${{ steps.version.outputs.version }} -o drop/nuget
26+
27+
- name: dotnet nuget push
28+
run: |
29+
dotnet nuget push drop/nuget/*.nupkg --api-key "${{ secrets.GITHUB_TOKEN }}" --skip-duplicate --source https://nuget.pkg.github.com/dotnet/index.json
30+

Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<PackageVersion Include="ICSharpCode.Decompiler" Version="8.2.0.7535" />
99
<PackageVersion Include="IgnoresAccessChecksToGenerator" Version="0.7.0" />
1010
<PackageVersion Include="Jint" Version="3.0.1" />
11-
<PackageVersion Include="JsonSchema.Net" Version="6.0.4" />
12-
<PackageVersion Include="Markdig" Version="0.35.0" />
11+
<PackageVersion Include="JsonSchema.Net" Version="6.0.7" />
12+
<PackageVersion Include="Markdig" Version="0.36.2" />
1313
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.9.2" />
1414
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
1515
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
@@ -23,7 +23,7 @@
2323
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
2424
<PackageVersion Include="OneOf" Version="3.0.263" />
2525
<PackageVersion Include="OneOf.SourceGenerator" Version="3.0.263" />
26-
<PackageVersion Include="PdfPig" Version="0.1.9-alpha-20240312-845e3" />
26+
<PackageVersion Include="PdfPig" Version="0.1.9-alpha-20240324-e7896" />
2727
<PackageVersion Include="PlantUml.Net" Version="1.4.80" />
2828
<PackageVersion Include="Spectre.Console" Version="0.48.0" />
2929
<PackageVersion Include="Spectre.Console.Cli" Version="0.48.0" />
@@ -37,7 +37,7 @@
3737
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
3838
<PackageVersion Include="PublicApiGenerator" Version="11.1.0" />
3939
<PackageVersion Include="Verify.DiffPlex" Version="2.3.0" />
40-
<PackageVersion Include="Verify.Xunit" Version="23.5.0" />
40+
<PackageVersion Include="Verify.Xunit" Version="23.5.2" />
4141
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
4242
<PackageVersion Include="xunit" Version="2.7.0" />
4343
</ItemGroup>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Docfx is planned to continue as a community-driven project. We hope to produce f
3636
3737
For more information, refer to [Getting Started](http://dotnet.github.io/docfx/tutorial/docfx_getting_started.html).
3838
39+
> [!TIP]
40+
> Docfx publishes nightly builds to [GitHub Packages](https://github.com/orgs/dotnet/packages), this allows you to stay up-to-date with the latest developments in Docfx.
41+
3942
## Contributing
4043
4144
Use [Discussions](https://github.com/dotnet/docfx/discussions) for questions and general discussions.

docs/docs/markdown.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Alternatively, set the `build.markdownEngineProperties.markdigExtensions` proper
5050
}
5151
```
5252

53+
The known extension names are listed in [MardownExtensions.Configure](https://github.com/xoofx/markdig/blob/master/src/Markdig/MarkdownExtensions.cs) method in the MarkDig project.
54+
5355
> [!Note]
5456
> The custom configuration of extensions via the `build.markdownEngineProperties.markdigExtensions` property is not supported.
5557

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docfx build
1+
# docfx template
22

33
## Name
44

docs/reference/docfx-json-reference.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ The `docfx.json` file indicates that the directory is the root of a docfx projec
1010
}
1111
```
1212

13-
## Global properties
13+
## Global properties
1414

15-
### `rules`
15+
## `rules`
1616

1717
Overrides default log message severity level. Key is the log code, supported values are `verbose`, `info`, `suggestion`, `warning`, `error`:
1818

@@ -148,6 +148,7 @@ Templates are used to transform YAML files generated by `docfx` to human-readabl
148148
}
149149
}
150150
```
151+
151152
```json
152153
{
153154
"build": {
@@ -166,7 +167,6 @@ The themes applied to the documentation. Theme is used to customize the styles g
166167

167168
Theme is to provide general styles for all the generated pages. Files inside a theme will be generally copied to the output folder. A typical usage is, after YAML files are transformed to HTML pages, well-designed CSS style files in a Theme can then overwrite the default styles defined in template, e.g. `main.css`.
168169

169-
170170
### `xref`
171171

172172
Specifies the urls of xrefmap used by content files. Currently, it supports following scheme: http, https, file.
@@ -199,6 +199,22 @@ Sets the max parallelism. Setting 0 (default) is the same as setting to the coun
199199

200200
Sets the parameters for the markdown engine, value is a JSON object.
201201

202+
### `customLinkResolver`
203+
204+
Set the name of the `ICustomHrefGenerator` derived class.
205+
206+
### `groups`
207+
208+
Specifies the output folder of specified group name.
209+
210+
```json
211+
"groups":
212+
"v1": {
213+
"dest": "output_dir_v1"
214+
}
215+
}
216+
```
217+
202218
### `sitemap`
203219

204220
Specifies the options for generating [sitemap.xml](https://www.sitemaps.org/protocol.html) file:
@@ -320,6 +336,12 @@ Specifies the output folder of the generated metadata files relative to `docfx.j
320336

321337
If set to true, DocFX would not render triple-slash-comments in source code as markdown.
322338

339+
### `references`
340+
341+
Specify additinal assembly reference files.
342+
This settings is used when generating metadata from DLLs or source files.
343+
Solution or project file-based metadata generation does not use this property.
344+
323345
### `filter`
324346

325347
Specifies the filter configuration file, please go to [How to filter out unwanted apis attributes](../tutorial/howto_filter_out_unwanted_apis_attributes.md) for more details.
@@ -332,6 +354,10 @@ Disables the default filter configuration file.
332354

333355
Disables generation of view source links.
334356

357+
### `codeSourceBasePath`
358+
359+
Specify the base directory that is used to resolve code source (e.g. `<code source="Example.cs">`).
360+
335361
### `properties`
336362

337363
Specifies an optional set of MSBuild properties used when interpreting project files. These are the same properties that are passed to msbuild via the `/property:name=value` command line argument.
@@ -372,7 +398,7 @@ Specifies how member pages are organized:
372398

373399
When enabled, continues documentation generation in case of compilation errors.
374400

375-
### `EnumSortOrder`
401+
### `enumSortOrder`
376402

377403
Specifies how enum members are sorted:
378404

src/Docfx.App/Config/BuildJsonConfig.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,13 @@ internal class BuildJsonConfig
202202
public string CustomLinkResolver { get; set; }
203203

204204
/// <summary>
205-
/// Define groups.
205+
/// Specifies the output folder of specified group name.
206206
/// </summary>
207207
/// <example>
208208
/// <code>
209209
/// groups:{
210210
/// "v1": {
211-
/// "dest": "v1",
212-
/// "extraMetadata01": {}
211+
/// "dest": "output_dir_v1"
213212
/// }
214213
/// }
215214
/// </code>

src/Docfx.App/PdfBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ await Parallel.ForEachAsync(pages, async (item, _) =>
291291
if (outline.pdfTocPage)
292292
{
293293
var href = $"/_pdftoc{outlineUrl.AbsolutePath}";
294-
yield return (new(outlineUrl, href), new() { href = href, pdfPrintBackground = outline.pdfPrintBackground });
294+
yield return (new(outlineUrl, href), new() { href = href, pdfPrintBackground = outline.pdfPrintBackground });
295295
}
296296

297297
if (!string.IsNullOrEmpty(outline.href))
@@ -325,6 +325,9 @@ async Task MergePdf()
325325
// Refresh TOC page numbers
326326
updatePageNumbers(pageNumbers);
327327
bytes = await printPdf(outline, url);
328+
329+
if (bytes == null)
330+
continue;
328331
}
329332

330333
using var document = PdfDocument.Open(bytes);

src/Docfx.Build.SchemaDriven/Validators/SchemaValidator.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ public class SchemaValidator
1111
{
1212
private readonly JsonSchema _schema;
1313

14+
private static readonly EvaluationOptions DefaultOptions = new EvaluationOptions
15+
{
16+
ValidateAgainstMetaSchema = false,
17+
OutputFormat = OutputFormat.List,
18+
};
19+
1420
static SchemaValidator()
1521
{
1622
SchemaRegistry.Global.Register(new("http://dotnet.github.io/docfx/schemas/v1.0/schema.json#"), MetaSchemas.Draft7);
@@ -25,11 +31,7 @@ public SchemaValidator(string json)
2531
public void Validate(object obj)
2632
{
2733
var json = JsonSerializer.Serialize(obj);
28-
var result = _schema.Evaluate(JsonDocument.Parse(json), new EvaluationOptions
29-
{
30-
ValidateAgainstMetaSchema = false,
31-
OutputFormat = OutputFormat.List,
32-
});
34+
var result = _schema.Evaluate(JsonDocument.Parse(json), DefaultOptions);
3335

3436
if (result.IsValid)
3537
return;

src/Docfx.Build/HostServiceCreator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ public virtual (FileModel model, bool valid) Load(
6363
{
6464
if (e is not DocumentException)
6565
{
66+
var message = e is ArgumentException or NullReferenceException
67+
? e.ToString()
68+
: e.Message;
69+
6670
Logger.LogError(
67-
$"Unable to load file '{file.File}' via processor '{processor.Name}': {e.Message}",
71+
$"Unable to load file '{file.File}' via processor '{processor.Name}': {message}",
6872
code: ErrorCodes.Build.InvalidInputFile);
6973
}
7074
return (null, false);

src/Docfx.Dotnet/Filters/ConfigFilterRuleItemUnion.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public ConfigFilterRuleItem Rule
5454
}
5555

5656
// If kind is not specified for exclude. Set `ExtendedSymbolKind.Type` as default kind.
57-
Exclude.Kind ??= ExtendedSymbolKind.Type | ExtendedSymbolKind.Member;
57+
if (Exclude != null)
58+
{
59+
Exclude.Kind ??= ExtendedSymbolKind.Type | ExtendedSymbolKind.Member;
60+
}
5861

5962
return Exclude;
6063
}

src/Docfx.Dotnet/MetadataJsonConfig.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ internal class MetadataJsonItemConfig
118118
[JsonPropertyName("shouldSkipMarkup")]
119119
public bool? ShouldSkipMarkup { get; set; }
120120

121-
[JsonProperty("raw")]
122-
[JsonPropertyName("raw")]
123-
public bool? Raw { get; set; }
124-
121+
/// <summary>
122+
/// Specify additinal assembly reference files.
123+
/// This settings is used when generating metadata from DLLs or source files.
124+
/// Solution or project file-based metadata generation does not use this property.
125+
/// </summary>
125126
[JsonProperty("references")]
126127
[JsonPropertyName("references")]
127128
public FileMapping References { get; set; }

templates/common/ManagedReference.common.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,9 @@ function handleItem(vm, gitContribute, gitUrlPattern) {
261261

262262
return array;
263263
}
264+
if(vm.syntax.typeParameters) {
265+
vm.syntax.typeParameters.forEach(item => {
266+
item.description = item.description || "";
267+
});
268+
}
264269
}

0 commit comments

Comments
 (0)