Skip to content

Commit 9f5180b

Browse files
ZimmerAmr-c
andauthored
Add support for DocFx doc generation to dotnet codegen (#557)
* Add support for DocFx doc generation to dotnet codegen * Fix CI * Update schema_salad/dotnet_codegen.py Co-authored-by: Michael R. Crusoe <[email protected]> * Fix error in pd string Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent b65373e commit 9f5180b

File tree

11 files changed

+120
-11
lines changed

11 files changed

+120
-11
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiRules:
2+
- exclude:
3+
# inherited members from Form
4+
uidRegex: ^System\.Windows\.Forms\.Form\..*$
5+
type: Member
6+
- exclude:
7+
# inherited members from Control
8+
uidRegex: ^System\.Windows\.Forms\.Control\..*$
9+
type: Member
10+
- exclude:
11+
# mentioning types from System.* namespace
12+
uidRegex: ^System\..*$
13+
type: Type
14+
- exclude:
15+
# mentioning types from Microsoft.* namespace
16+
uidRegex: ^Microsoft\..*$
17+
type: Type

schema_salad/dotnet/DocFx/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
${project_description}

schema_salad/dotnet/DocFx/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Home
2+
href: index.md
3+
- name: API-Reference
4+
href: reference/

schema_salad/dotnet/Project.csproj renamed to schema_salad/dotnet/Project.csproj.template

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<EnablePreviewFeatures>True</EnablePreviewFeatures>
9+
<PackageId>${project_name}</PackageId>
10+
<Version>0.1.0</Version>
11+
<Authors></Authors>
12+
<BuildDocFx Condition=" '$(Configuration)'=='Debug' ">false</BuildDocFx>
913
</PropertyGroup>
1014

1115
<ItemGroup>
16+
<PackageReference Include="docfx.console" Version="2.59.2">
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
</PackageReference>
1220
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="4.2.0">
1321
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1422
<PrivateAssets>all</PrivateAssets>

schema_salad/dotnet/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ${project_name}
2+
${project_description}

schema_salad/dotnet/docfx.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"files": [
7+
"*.csproj"
8+
],
9+
"src": "./"
10+
}
11+
],
12+
"dest": "../DocFx/reference",
13+
"disableGitFeatures": false,
14+
"disableDefaultFilter": false,
15+
"filter": "../DocFx/filterConfig.yml"
16+
}
17+
],
18+
"build": {
19+
"content": [
20+
{
21+
"files": [
22+
"reference/**.yml",
23+
"reference/index.md"
24+
],
25+
"src": "../DocFx"
26+
},
27+
{
28+
"files": [
29+
"*.md",
30+
"toc.yml"
31+
],
32+
"src": "../DocFx"
33+
}
34+
],
35+
"resource": [
36+
{
37+
"files": [
38+
"images/**"
39+
],
40+
"src": "../DocFx"
41+
}
42+
],
43+
"dest": "../docs",
44+
"globalMetadataFiles": [],
45+
"fileMetadataFiles": [],
46+
"postProcessors": [],
47+
"markdownEngineName": "markdig",
48+
"noLangKeyword": false,
49+
"keepFileLink": false,
50+
"cleanupCacheHistory": false,
51+
"disableGitFeatures": false,
52+
"globalMetadata": {
53+
"_appTitle": "Documentation",
54+
"_enableSearch": true,
55+
"_disableContribution": true
56+
}
57+
}
58+
}

schema_salad/dotnet/.gitignore renamed to schema_salad/dotnet/gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,4 +395,8 @@ FodyWeavers.xsd
395395
*.msp
396396

397397
# JetBrains Rider
398-
*.sln.iml
398+
*.sln.iml
399+
400+
# DocFx
401+
DocFx/
402+
CWLDotNet/log.txt

schema_salad/dotnet/util/Loaders/RootLoader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace ${project_name};
55

66
public class RootLoader
77
{
8-
public static ${root_loader_type} LoadDocument(in Dictionary<object, object> doc, in string baseUri_, in LoadingOptions? loadingOptions_ = null)
8+
public static ${root_loader_type} LoadDocument(Dictionary<object, object> doc, string baseUri_, LoadingOptions? loadingOptions_ = null)
99
{
1010
string baseUri = EnsureBaseUri(baseUri_);
1111
LoadingOptions loadingOptions;
@@ -23,7 +23,7 @@ public class RootLoader
2323
return outDoc;
2424
}
2525

26-
public static ${root_loader_type} LoadDocument(in string doc, in string uri_, in LoadingOptions? loadingOptions_ = null)
26+
public static ${root_loader_type} LoadDocument(string doc, string uri_, LoadingOptions? loadingOptions_ = null)
2727
{
2828
string uri = EnsureBaseUri(uri_);
2929
LoadingOptions loadingOptions;

schema_salad/dotnet/util/Utilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static string Shortname(string inputId)
2626
}
2727
}
2828

29-
public static UriBuilder Split(string uri)
29+
internal static UriBuilder Split(string uri)
3030
{
3131
Uri splitUri = new(uri, UriKind.RelativeOrAbsolute);
3232
UriBuilder split;

0 commit comments

Comments
 (0)