From 95df9c9cc6f33773a907bf59d07a3ffa1c4a79c4 Mon Sep 17 00:00:00 2001 From: Morten Nielsen Date: Mon, 15 Mar 2021 22:04:59 -0700 Subject: [PATCH] Add applies-to section to documentation --- docs/BuildDoc.cmd | 5 + docs/appliesToList.json | 24 +- docs/docfx.json | 7 +- .../partials/class.tmpl.partial | 78 ++++++ .../partials/collection.tmpl.partial | 257 ++++++++++++++++++ docs/template_overrides/styles/main.css | 9 + 6 files changed, 367 insertions(+), 13 deletions(-) create mode 100644 docs/template_overrides/partials/class.tmpl.partial create mode 100644 docs/template_overrides/partials/collection.tmpl.partial diff --git a/docs/BuildDoc.cmd b/docs/BuildDoc.cmd index 49f215c..658c39f 100644 --- a/docs/BuildDoc.cmd +++ b/docs/BuildDoc.cmd @@ -23,6 +23,11 @@ mkdir %~dp0../artifacts/docs/api %~dp0..\.tools\nuget install memberpage -Version 2.56.7 -OutputDirectory %~dp0 REM Build the output site (HTML) from the generated metadata and input files (uses configuration in docfx.json in this folder) %DocFxFolder%\v%DocFXVersion%\docfx.exe %~dp0\docfx.json + +REM Build applies-to version/framework info +dotnet build AppliesToGenerator\DocFXAppliesToGenerator.csproj +AppliesToGenerator\bin\Debug\netcoreapp3.1\DocFXAppliesToGenerator.exe appliesToList.json + ECHO Fixing API Reference Links powershell -ExecutionPolicy ByPass -command "%~dp0FixApiRefLinks.ps1" -Path %~dp0..\artifacts\docs_site\api\ start http://localhost:8080 diff --git a/docs/appliesToList.json b/docs/appliesToList.json index edd3654..3e3fd57 100644 --- a/docs/appliesToList.json +++ b/docs/appliesToList.json @@ -5,54 +5,54 @@ "PlatformName": ".NET Standard 1.4", "Versions" : [ { "Name" : "GitHub", "Manifest": "../artifacts/docs/api/netstd/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/netstd/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/netstd/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/netstd/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/netstd/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/netstd/.manifest" }, ] }, { "PlatformName": ".NET Framework", "Versions" : [ { "Name" : "GitHub", "Manifest": "../artifacts/docs/api/netfx/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/netfx/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/netfx/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/netfx/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/netfx/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/netfx/.manifest" } ] }, { "PlatformName": ".NET Core", "Versions" : [ { "Name": "GitHub", "Manifest": "../artifacts/docs/api/netcore/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/netcore/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/netcore/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/netcore/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/netcore/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/netcore/.manifest" } ] }, { "PlatformName": "Xamarin.Android", "Versions" : [ { "Name": "GitHub", "Manifest": "../artifacts/docs/api/android/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/android/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/android/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/android/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/android/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/android/.manifest" } ] }, { "PlatformName": "Xamarin.iOS", "Versions" : [ { "Name" : "GitHub", "Manifest": "../artifacts/docs/api/ios/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/ios/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/ios/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/ios/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/ios/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/ios/.manifest" } ] }, { "PlatformName": "UWP", "Versions" : [ { "Name" : "GitHub", "Manifest": "../artifacts/docs/api/uwp/.manifest" }, - { "Name" : "v2.0", "Manifest": "manifests/v2.0/uwp/.manifest" }, + { "Name" : "v2.2", "Manifest": "manifests/v2.2/uwp/.manifest" }, { "Name" : "v2.1", "Manifest": "manifests/v2.1/uwp/.manifest" }, - { "Name" : "v2.2", "Manifest": "manifests/v2.2/uwp/.manifest" } + { "Name" : "v2.0", "Manifest": "manifests/v2.0/uwp/.manifest" } ] } ] diff --git a/docs/docfx.json b/docs/docfx.json index 76fc524..b10f0f8 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -114,6 +114,12 @@ "obj/**", "_site/**" ] + }, + { + "files": [ + "*.md" + ], + "src" : "../artifacts/docs/api_overwrites" } ], "globalMetadata": { @@ -132,7 +138,6 @@ "template_overrides" ], "postProcessors": [], - "markdownEngineName": "markdig", "noLangKeyword": false, "keepFileLink": false, "xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ], diff --git a/docs/template_overrides/partials/class.tmpl.partial b/docs/template_overrides/partials/class.tmpl.partial new file mode 100644 index 0000000..548c5bc --- /dev/null +++ b/docs/template_overrides/partials/class.tmpl.partial @@ -0,0 +1,78 @@ +{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + +{{>partials/class.header}} +{{#children}} +{{#overload}} + +{{/overload}} +

{{>partials/classSubtitle}}

+{{#children.0}} + + + + + + + + + {{/children.0}} + {{#children}} + + + + + {{/children}} + {{#children.0}} + +
{{__global.name}}{{__global.description}}
+ + {{{summary}}}
+{{/children.0}} +{{/children}} +{{#extensionMethods.0}} +

{{__global.extensionMethods}}

+{{/extensionMethods.0}} +{{#extensionMethods}} +
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
+{{/extensionMethods}} +{{#seealso.0}} +

{{__global.seealso}}

+
+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
{{{type.specName.0.value}}}
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} +{{#appliesTo.0}} +

Applies to

+ +
+
+ + + +{{/appliesTo.0}} +{{#appliesTo}} + +{{/appliesTo}} +{{#appliesTo.0}} + + +
TargetVersions
{{platform}}{{versions}}
+
+
+{{/appliesTo.0}} diff --git a/docs/template_overrides/partials/collection.tmpl.partial b/docs/template_overrides/partials/collection.tmpl.partial new file mode 100644 index 0000000..151ca4f --- /dev/null +++ b/docs/template_overrides/partials/collection.tmpl.partial @@ -0,0 +1,257 @@ +{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + +

{{>partials/title}}

+
{{{summary}}}
+
{{{conceptual}}}
+ +{{#children}} +{{#children}} +{{^_disableContribution}} +{{#docurl}} + + | + {{__global.improveThisDoc}} +{{/docurl}} +{{#sourceurl}} + + {{__global.viewSource}} +{{/sourceurl}} +{{/_disableContribution}} +{{#overload}} + +{{/overload}} +

{{name.0.value}}

+
{{{summary}}}
+
{{{conceptual}}}
+
{{__global.declaration}}
+{{#syntax}} +
+
{{syntax.content.0.value}}
+
+{{#parameters.0}} +
{{__global.parameters}}
+ + + + + + + + + +{{/parameters.0}} +{{#parameters}} + + + + + +{{/parameters}} +{{#parameters.0}} + +
{{__global.type}}{{__global.name}}{{__global.description}}
{{{type.specName.0.value}}}{{{id}}}{{{description}}}
+{{/parameters.0}} +{{#return}} +
{{__global.returns}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+{{/return}} +{{#typeParameters.0}} +
{{__global.typeParameters}}
+ + + + + + + + +{{/typeParameters.0}} +{{#typeParameters}} + + + + +{{/typeParameters}} +{{#typeParameters.0}} + +
{{__global.name}}{{__global.description}}
{{{id}}}{{{description}}}
+{{/typeParameters.0}} +{{#fieldValue}} +
{{__global.fieldValue}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+{{/fieldValue}} +{{#propertyValue}} +
{{__global.propertyValue}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+{{/propertyValue}} +{{#eventType}} +
{{__global.eventType}}
+ + + + + + + + + + + + + +
{{__global.type}}{{__global.description}}
{{{type.specName.0.value}}}{{{description}}}
+{{/eventType}} +{{/syntax}} +{{#overridden}} +
{{__global.overrides}}
+
+{{/overridden}} +{{#implements.0}} +
{{__global.implements}}
+{{/implements.0}} +{{#implements}} + {{#definition}} +
+ {{/definition}} + {{^definition}} +
+ {{/definition}} +{{/implements}} +{{#remarks}} +
{{__global.remarks}}
+
{{{remarks}}}
+{{/remarks}} +{{#example.0}} +
{{__global.examples}}
+{{/example.0}} +{{#example}} +{{{.}}} +{{/example}} +{{#exceptions.0}} +
{{__global.exceptions}}
+ + + + + + + + +{{/exceptions.0}} +{{#exceptions}} + + + + +{{/exceptions}} +{{#exceptions.0}} + +
{{__global.type}}{{__global.condition}}
{{{type.specName.0.value}}}{{{description}}}
+{{/exceptions.0}} +{{#seealso.0}} +
{{__global.seealso}}
+
+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
{{{type.specName.0.value}}}
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} +{{#appliesTo.0}} +

Applies to

+
+
+ + Platforms and versions + +
+ + + +{{/appliesTo.0}} +{{#appliesTo}} + +{{/appliesTo}} +{{#appliesTo.0}} + + +
TargetVersions
{{platform}}{{versions}}
+
+
+
+{{/appliesTo.0}} +{{/children}} +{{/children}} +{{#extensionMethods.0}} +

{{__global.extensionMethods}}

+{{/extensionMethods.0}} +{{#extensionMethods}} +
+ {{#definition}} + + {{/definition}} + {{^definition}} + + {{/definition}} +
+{{/extensionMethods}} +{{#seealso.0}} +

{{__global.seealso}}

+
+{{/seealso.0}} +{{#seealso}} + {{#isCref}} +
{{{type.specName.0.value}}}
+ {{/isCref}} + {{^isCref}} +
{{{url}}}
+ {{/isCref}} +{{/seealso}} +{{#seealso.0}} +
+{{/seealso.0}} diff --git a/docs/template_overrides/styles/main.css b/docs/template_overrides/styles/main.css index 9174371..e904631 100644 --- a/docs/template_overrides/styles/main.css +++ b/docs/template_overrides/styles/main.css @@ -251,3 +251,12 @@ pre { border: none; box-shadow: var(--custom-box-shadow); } +details +{ + display:block; +} +summary +{ + cursor: pointer; + display: list-item; +} \ No newline at end of file