Add applies-to section to documentation

This commit is contained in:
Morten Nielsen 2021-03-15 22:04:59 -07:00
parent 9a6940b84d
commit 95df9c9cc6
6 changed files with 367 additions and 13 deletions

View file

@ -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

View file

@ -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" }
]
}
]

View file

@ -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}" ],

View file

@ -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}}
<a id="{{id}}" data-uid="{{uid}}"></a>
{{/overload}}
<h3 id="{{id}}">{{>partials/classSubtitle}}</h3>
{{#children.0}}
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/children.0}}
{{#children}}
<tr>
<td id="{{id}}" data-uid="{{uid}}">
<xref uid="{{uid}}" altProperty="fullName" displayProperty="name"/>
</td>
<td class="markdown level1 summary">{{{summary}}}</td>
</tr>
{{/children}}
{{#children.0}}
</tbody>
</table>
{{/children.0}}
{{/children}}
{{#extensionMethods.0}}
<h3 id="extensionmethods">{{__global.extensionMethods}}</h3>
{{/extensionMethods.0}}
{{#extensionMethods}}
<div>
{{#definition}}
<xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/>
{{/definition}}
{{^definition}}
<xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/>
{{/definition}}
</div>
{{/extensionMethods}}
{{#seealso.0}}
<h3 id="seealso">{{__global.seealso}}</h3>
<div class="seealso">
{{/seealso.0}}
{{#seealso}}
{{#isCref}}
<div>{{{type.specName.0.value}}}</div>
{{/isCref}}
{{^isCref}}
<div>{{{url}}}</div>
{{/isCref}}
{{/seealso}}
{{#seealso.0}}
</div>
{{/seealso.0}}
{{#appliesTo.0}}
<h3 id="appliesTo">Applies to</h3>
<div class="appliesto">
<div>
<table>
<thead><th>Target</th><th>Versions</th></thead>
<tbody>
{{/appliesTo.0}}
{{#appliesTo}}
<tr><td><b>{{platform}}</b></td><td>{{versions}}</td></tr>
{{/appliesTo}}
{{#appliesTo.0}}
</tbody>
</thead>
</table>
</div>
</div>
{{/appliesTo.0}}

View file

@ -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.}}
<h1 id="{{id}}" data-uid="{{uid}}">{{>partials/title}}</h1>
<div class="markdown level0 summary">{{{summary}}}</div>
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
{{#children}}
{{#children}}
{{^_disableContribution}}
{{#docurl}}
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="{{docurl}}">{{__global.improveThisDoc}}</a>
</span>{{/docurl}}
{{#sourceurl}}
<span class="small pull-right mobile-hide">
<a href="{{sourceurl}}">{{__global.viewSource}}</a>
</span>{{/sourceurl}}
{{/_disableContribution}}
{{#overload}}
<a id="{{id}}" data-uid="{{uid}}"></a>
{{/overload}}
<h4 id="{{id}}" data-uid="{{uid}}">{{name.0.value}}</h4>
<div class="markdown level1 summary">{{{summary}}}</div>
<div class="markdown level1 conceptual">{{{conceptual}}}</div>
<h5 class="decalaration">{{__global.declaration}}</h5>
{{#syntax}}
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{#parameters.0}}
<h5 class="parameters">{{__global.parameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/parameters.0}}
{{#parameters}}
<tr>
<td>{{{type.specName.0.value}}}</td>
<td><span class="parametername">{{{id}}}</span></td>
<td>{{{description}}}</td>
</tr>
{{/parameters}}
{{#parameters.0}}
</tbody>
</table>
{{/parameters.0}}
{{#return}}
<h5 class="returns">{{__global.returns}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/return}}
{{#typeParameters.0}}
<h5 class="typeParameters">{{__global.typeParameters}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.name}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
{{/typeParameters.0}}
{{#typeParameters}}
<tr>
<td><span class="parametername">{{{id}}}</span></td>
<td>{{{description}}}</td>
</tr>
{{/typeParameters}}
{{#typeParameters.0}}
</tbody>
</table>
{{/typeParameters.0}}
{{#fieldValue}}
<h5 class="fieldValue">{{__global.fieldValue}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/fieldValue}}
{{#propertyValue}}
<h5 class="propertyValue">{{__global.propertyValue}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/propertyValue}}
{{#eventType}}
<h5 class="eventType">{{__global.eventType}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.description}}</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
</tbody>
</table>
{{/eventType}}
{{/syntax}}
{{#overridden}}
<h5 class="overrides">{{__global.overrides}}</h5>
<div><xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/></div>
{{/overridden}}
{{#implements.0}}
<h5 class="implements">{{__global.implements}}</h5>
{{/implements.0}}
{{#implements}}
{{#definition}}
<div><xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/></div>
{{/definition}}
{{^definition}}
<div><xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/></div>
{{/definition}}
{{/implements}}
{{#remarks}}
<h5 id="{{id}}_remarks">{{__global.remarks}}</h5>
<div class="markdown level1 remarks">{{{remarks}}}</div>
{{/remarks}}
{{#example.0}}
<h5 id="{{id}}_examples">{{__global.examples}}</h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}
{{#exceptions.0}}
<h5 class="exceptions">{{__global.exceptions}}</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{{__global.type}}</th>
<th>{{__global.condition}}</th>
</tr>
</thead>
<tbody>
{{/exceptions.0}}
{{#exceptions}}
<tr>
<td>{{{type.specName.0.value}}}</td>
<td>{{{description}}}</td>
</tr>
{{/exceptions}}
{{#exceptions.0}}
</tbody>
</table>
{{/exceptions.0}}
{{#seealso.0}}
<h5 id="{{id}}_seealso">{{__global.seealso}}</h5>
<div class="seealso">
{{/seealso.0}}
{{#seealso}}
{{#isCref}}
<div>{{{type.specName.0.value}}}</div>
{{/isCref}}
{{^isCref}}
<div>{{{url}}}</div>
{{/isCref}}
{{/seealso}}
{{#seealso.0}}
</div>
{{/seealso.0}}
{{#appliesTo.0}}
<h3 id="appliesTo">Applies to</h3>
<div class="appliesto">
<details>
<summary class="has-margin-bottom-medium">
Platforms and versions
</summary>
<div>
<table>
<thead><th>Target</th><th>Versions</th></thead>
<tbody>
{{/appliesTo.0}}
{{#appliesTo}}
<tr><td><b>{{platform}}</b></td><td>{{versions}}</td></tr>
{{/appliesTo}}
{{#appliesTo.0}}
</tbody>
</thead>
</table>
</div>
</details>
</div>
{{/appliesTo.0}}
{{/children}}
{{/children}}
{{#extensionMethods.0}}
<h3 id="extensionmethods">{{__global.extensionMethods}}</h3>
{{/extensionMethods.0}}
{{#extensionMethods}}
<div>
{{#definition}}
<xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/>
{{/definition}}
{{^definition}}
<xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/>
{{/definition}}
</div>
{{/extensionMethods}}
{{#seealso.0}}
<h3 id="seealso">{{__global.seealso}}</h3>
<div class="seealso">
{{/seealso.0}}
{{#seealso}}
{{#isCref}}
<div>{{{type.specName.0.value}}}</div>
{{/isCref}}
{{^isCref}}
<div>{{{url}}}</div>
{{/isCref}}
{{/seealso}}
{{#seealso.0}}
</div>
{{/seealso.0}}

View file

@ -251,3 +251,12 @@ pre {
border: none;
box-shadow: var(--custom-box-shadow);
}
details
{
display:block;
}
summary
{
cursor: pointer;
display: list-item;
}