Delete the redundant files and point to common scripts (#1062)

This commit is contained in:
Sima Zhu 2020-12-02 17:23:58 -08:00 committed by GitHub
parent 3822ca8729
commit 8d1450b855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 3 additions and 1279 deletions

View File

@ -1,150 +0,0 @@
# Generates an index page for cataloging different versions of the Docs
[CmdletBinding()]
Param (
$DocFx,
$RepoRoot,
$DocGenDir,
$DocOutDir = "${RepoRoot}/docfx_project"
)
. "${PSScriptRoot}\..\..\common\scripts\common.ps1"
$GetGithubIoDocIndexFn = "Get-${Language}-GithubIoDocIndex"
# Given the metadata url under https://github.com/Azure/azure-sdk/tree/master/_data/releases/latest,
# the function will return the csv metadata back as part of response.
function Get-CSVMetadata ([string]$MetadataUri) {
$metadataResponse = Invoke-RestMethod -Uri $MetadataUri -method "GET" -MaximumRetryCount 3 -RetryIntervalSec 10 | ConvertFrom-Csv
return $metadataResponse
}
# Given the github io blob storage url and language regex,
# the helper function will return a list of artifact names.
function Get-BlobStorage-Artifacts($blobStorageUrl, $blobDirectoryRegex, $blobArtifactsReplacement) {
LogDebug "Reading artifact from storage blob ..."
$returnedArtifacts = @()
$pageToken = ""
Do {
$resp = ""
if (!$pageToken) {
# First page call.
$resp = Invoke-RestMethod -Method Get -Uri $blobStorageUrl
}
else {
# Next page call
$blobStorageUrlPageToken = $blobStorageUrl + "&marker=$pageToken"
$resp = Invoke-RestMethod -Method Get -Uri $blobStorageUrlPageToken
}
# Convert to xml documents.
$xmlDoc = [xml](removeBomFromString $resp)
foreach ($elem in $xmlDoc.EnumerationResults.Blobs.BlobPrefix) {
# What service return like "dotnet/Azure.AI.Anomalydetector/", needs to fetch out "Azure.AI.Anomalydetector"
$artifact = $elem.Name -replace $blobDirectoryRegex, $blobArtifactsReplacement
$returnedArtifacts += $artifact
}
# Fetch page token
$pageToken = $xmlDoc.EnumerationResults.NextMarker
} while ($pageToken)
return $returnedArtifacts
}
# The sequence of Bom bytes differs by different encoding.
# The helper function here is only to strip the utf-8 encoding system as it is used by blob storage list api.
# Return the original string if not in BOM utf-8 sequence.
function RemoveBomFromString([string]$bomAwareString) {
if ($bomAwareString.length -le 3) {
return $bomAwareString
}
$bomPatternByteArray = [byte[]] (0xef, 0xbb, 0xbf)
# The default encoding for powershell is ISO-8859-1, so converting bytes with the encoding.
$bomAwareBytes = [Text.Encoding]::GetEncoding(28591).GetBytes($bomAwareString.Substring(0, 3))
if (@(Compare-Object $bomPatternByteArray $bomAwareBytes -SyncWindow 0).Length -eq 0) {
return $bomAwareString.Substring(3)
}
return $bomAwareString
}
function Get-TocMapping {
Param (
[Parameter(Mandatory = $true)] [Object[]] $metadata,
[Parameter(Mandatory = $true)] [String[]] $artifacts
)
# Used for sorting the toc display order
$orderServiceMapping = @{}
foreach ($artifact in $artifacts) {
$packageInfo = $metadata | ? {$_.Package -eq $artifact}
if ($packageInfo -and $packageInfo[0].Hide -eq 'true') {
LogDebug "The artifact $artifact set 'Hide' to 'true'."
continue
}
$serviceName = ""
if (!$packageInfo -or !$packageInfo[0].ServiceName) {
LogWarning "There is no service name for artifact $artifact. Please check csv of Azure/azure-sdk/_data/release/latest repo if this is intended. "
# If no service name retrieved, print out warning message, and put it into Other page.
$serviceName = "Other"
}
else {
if ($packageInfo.Length -gt 1) {
LogWarning "There are more than 1 packages fetched out for artifact $artifact. Please check csv of Azure/azure-sdk/_data/release/latest repo if this is intended. "
}
$serviceName = $packageInfo[0].ServiceName.Trim()
}
$orderServiceMapping[$artifact] = $serviceName
}
return $orderServiceMapping
}
function GenerateDocfxTocContent([Hashtable]$tocContent, [String]$lang) {
LogDebug "Start generating the docfx toc and build docfx site..."
LogDebug "Initializing Default DocFx Site..."
& $($DocFx) init -q -o "${DocOutDir}"
# The line below is used for testing in local
#docfx init -q -o "${DocOutDir}"
LogDebug "Copying template and configuration..."
New-Item -Path "${DocOutDir}" -Name "templates" -ItemType "directory" -Force
Copy-Item "${DocGenDir}/templates/*" -Destination "${DocOutDir}/templates" -Force -Recurse
Copy-Item "${DocGenDir}/docfx.json" -Destination "${DocOutDir}/" -Force
$YmlPath = "${DocOutDir}/api"
New-Item -Path $YmlPath -Name "toc.yml" -Force
$visitedService = @{}
# Sort and display toc service name by alphabetical order, and then sort artifact by order.
foreach ($serviceMapping in ($tocContent.GetEnumerator() | Sort-Object Value, Key)) {
$artifact = $serviceMapping.Key
$serviceName = $serviceMapping.Value
$fileName = ($serviceName -replace '\s', '').ToLower().Trim()
if ($visitedService.ContainsKey($serviceName)) {
Add-Content -Path "$($YmlPath)/${fileName}.md" -Value "#### $artifact"
}
else {
Add-Content -Path "$($YmlPath)/toc.yml" -Value "- name: ${serviceName}`r`n href: ${fileName}.md"
New-Item -Path $YmlPath -Name "${fileName}.md" -Force
Add-Content -Path "$($YmlPath)/${fileName}.md" -Value "#### $artifact"
$visitedService[$serviceName] = $true
}
}
# Generate toc homepage.
LogDebug "Creating Site Title and Navigation..."
New-Item -Path "${DocOutDir}" -Name "toc.yml" -Force
Add-Content -Path "${DocOutDir}/toc.yml" -Value "- name: Azure SDK for $lang APIs`r`n href: api/`r`n homepage: api/index.md"
LogDebug "Copying root markdowns"
Copy-Item "$($RepoRoot)/README.md" -Destination "${DocOutDir}/api/index.md" -Force
Copy-Item "$($RepoRoot)/CONTRIBUTING.md" -Destination "${DocOutDir}/api/CONTRIBUTING.md" -Force
LogDebug "Building site..."
& $($DocFx) build "${DocOutDir}/docfx.json"
# The line below is used for testing in local
#docfx build "${DocOutDir}/docfx.json"
Copy-Item "${DocGenDir}/assets/logo.svg" -Destination "${DocOutDir}/_site/" -Force
}
if ((Get-ChildItem -Path Function: | ? { $_.Name -eq $GetGithubIoDocIndexFn }).Count -gt 0)
{
&$GetGithubIoDocIndexFn
}
else
{
LogWarning "The function '$GetGithubIoDocIndexFn' was not found."
}

View File

@ -1,69 +0,0 @@
{
"metadata": [
{
"src": [],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"xrefService": [
"https://xref.docs.microsoft.com/query?uid={uid}"
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"templates/matthews"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false,
"globalMetadata": {
"_appTitle": "Azure SDK for C",
"_appFooter": "Azure SDK for C",
"_appFaviconPath": "https://c.s-microsoft.com/favicon.ico?v2",
"_enableSearch": true,
"_enableNewTab": true
}
}
}

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" id="logo" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="46.92px" height="46.315px" viewBox="0 0 46.92 46.315" style="enable-background:new 0 0 46.92 46.315;"
xml:space="preserve">
<style type="text/css">
<![CDATA[
.st0{fill:#DDDDDD;}
]]>
</style>
<g>
<g>
<path class="st0" d="M15.297,27.558l-0.47-1.53h-2.736l-0.526,1.53H9.922l2.649-7.418h1.798l2.614,7.418H15.297z M13.453,21.807
h-0.012l-0.948,2.948h1.889L13.453,21.807z"/>
<path class="st0" d="M17.341,27.558v-1.116l2.804-3.229h-2.613v-1.15h4.47v1.173l-2.805,3.139h2.883v1.185L17.341,27.558
L17.341,27.558z"/>
<path class="st0" d="M26.249,27.558v-0.77c-0.373,0.609-0.944,0.914-1.709,0.914c-0.276,0-0.529-0.047-0.756-0.144
c-0.226-0.097-0.424-0.233-0.585-0.415c-0.165-0.178-0.293-0.389-0.387-0.637c-0.094-0.245-0.14-0.521-0.14-0.826v-3.618h1.453
v3.396c0,0.686,0.311,1.028,0.929,1.028c0.37,0,0.651-0.119,0.842-0.353c0.192-0.235,0.286-0.534,0.286-0.899v-3.173h1.443v5.495
H26.249z"/>
<path class="st0" d="M28.429,27.558v-5.495h1.363v0.658c0.12-0.186,0.243-0.332,0.373-0.435c0.131-0.105,0.264-0.186,0.403-0.241
c0.138-0.056,0.278-0.091,0.419-0.107c0.141-0.013,0.287-0.022,0.434-0.022h0.189v1.486c-0.133-0.023-0.266-0.031-0.401-0.031
c-0.887,0-1.33,0.441-1.33,1.328v2.859H28.429z"/>
<path class="st0" d="M33.212,25.189c0.021,0.418,0.142,0.749,0.361,0.996c0.22,0.244,0.509,0.366,0.867,0.366
c0.237,0,0.448-0.056,0.631-0.164c0.181-0.106,0.3-0.257,0.353-0.45h1.496c-0.172,0.565-0.467,1.001-0.895,1.307
c-0.424,0.308-0.932,0.457-1.52,0.457c-1.831,0-2.747-0.996-2.747-2.992c0-0.424,0.058-0.81,0.178-1.151
c0.12-0.344,0.293-0.637,0.52-0.883c0.228-0.245,0.506-0.433,0.832-0.563c0.328-0.131,0.703-0.194,1.129-0.194
c0.85,0,1.494,0.272,1.927,0.814c0.436,0.544,0.655,1.364,0.655,2.459L33.212,25.189L33.212,25.189z M35.502,24.272
c-0.008-0.2-0.045-0.376-0.107-0.529s-0.146-0.28-0.25-0.38c-0.104-0.102-0.225-0.175-0.36-0.225
c-0.133-0.048-0.271-0.071-0.412-0.071c-0.291,0-0.542,0.106-0.753,0.319c-0.213,0.212-0.335,0.51-0.363,0.888h2.246V24.272z"/>
<path class="st0" d="M17.923,30.788c-0.038-0.38-0.175-0.661-0.413-0.85c-0.239-0.188-0.596-0.28-1.073-0.28
c-0.879,0-1.318,0.301-1.318,0.907c0,0.216,0.089,0.396,0.274,0.542c0.183,0.144,0.474,0.266,0.877,0.359
c0.477,0.117,0.89,0.219,1.24,0.317c0.35,0.095,0.668,0.207,0.96,0.332c0.165,0.068,0.319,0.152,0.464,0.253
c0.146,0.099,0.269,0.222,0.37,0.373c0.1,0.15,0.18,0.328,0.241,0.538c0.06,0.208,0.089,0.464,0.089,0.758
c0,0.355-0.074,0.677-0.223,0.949c-0.15,0.277-0.352,0.508-0.603,0.699c-0.254,0.19-0.553,0.333-0.895,0.434
c-0.342,0.101-0.704,0.152-1.083,0.152c-1.081,0-1.892-0.207-2.436-0.628c-0.545-0.418-0.832-1.032-0.861-1.854h1.497
c0.006,0.38,0.163,0.682,0.465,0.9c0.301,0.219,0.68,0.329,1.133,0.329c0.492,0,0.866-0.089,1.117-0.269
c0.254-0.178,0.38-0.421,0.38-0.728c0-0.119-0.015-0.228-0.044-0.326c-0.031-0.103-0.088-0.193-0.174-0.274
c-0.087-0.084-0.203-0.155-0.352-0.22c-0.15-0.064-0.342-0.119-0.581-0.174c-0.566-0.117-1.058-0.237-1.469-0.361
c-0.415-0.124-0.755-0.276-1.023-0.459c-0.269-0.184-0.466-0.403-0.592-0.665c-0.127-0.261-0.19-0.591-0.19-0.995
c0-0.305,0.056-0.594,0.167-0.86c0.111-0.269,0.283-0.5,0.515-0.697c0.23-0.197,0.515-0.354,0.855-0.471
c0.34-0.115,0.739-0.173,1.201-0.173c0.447,0,0.849,0.058,1.208,0.173c0.358,0.116,0.665,0.281,0.92,0.49
c0.256,0.212,0.457,0.469,0.598,0.773c0.142,0.303,0.222,0.632,0.235,0.998h-1.476V30.788z"/>
<path class="st0" d="M20.179,36.018v-7.42h2.874c0.498,0,0.961,0.084,1.387,0.254c0.422,0.164,0.787,0.404,1.087,0.717
c0.303,0.313,0.539,0.695,0.711,1.142c0.17,0.447,0.254,0.954,0.254,1.521c0,0.565-0.075,1.08-0.228,1.549
c-0.153,0.465-0.372,0.861-0.654,1.192c-0.281,0.331-0.623,0.59-1.014,0.775c-0.398,0.183-0.834,0.271-1.312,0.271H20.179z
M22.974,34.756c0.677,0,1.17-0.209,1.476-0.632c0.306-0.419,0.459-1.052,0.459-1.894c0-0.42-0.039-0.776-0.113-1.073
c-0.074-0.298-0.194-0.542-0.361-0.733c-0.167-0.19-0.383-0.327-0.643-0.415c-0.261-0.085-0.579-0.128-0.949-0.128H21.69v4.872
h1.283V34.756z"/>
<path class="st0" d="M31.689,36.018l-2.202-3.342l-0.823,0.817v2.524h-1.53v-7.42h1.53v3.018l2.838-3.018h2.01l-2.925,2.927
l2.991,4.492L31.689,36.018L31.689,36.018z"/>
</g>
<g>
<path class="st0" d="M14.765,39.33c-2.16,0-3.927-0.006-5.563-0.016c-2.536-0.016-4.625-1.017-6.209-2.979
c-1.229-1.524-1.793-3.27-1.678-5.191c0.176-2.971,1.701-5.256,4.41-6.608c0.397-0.199,0.433-0.294,0.44-0.688
c0.028-1.434,0.518-2.787,1.452-4.025c1.007-1.33,2.369-2.237,4.05-2.699c0.903-0.25,1.907-0.292,2.953-0.128
c0.584,0.089,1.137,0.287,1.668,0.476c0.066,0.022,0.13,0.045,0.195,0.068c0.517-1.254,1.284-2.365,2.293-3.313
c1.06-1,2.309-1.791,3.708-2.346c1.645-0.653,3.423-0.951,5.268-0.884c3.103,0.11,5.763,1.16,7.917,3.121
c1.729,1.579,2.735,3.528,2.992,5.793c0.004,0.038,0.012,0.074,0.017,0.108c0.02,0.095,0.042,0.211,0.042,0.343l-0.002,0.104
c0,0.004,0,0.009,0,0.01c0.057,0.019,0.121,0.038,0.198,0.063c1.579,0.522,2.956,1.4,4.094,2.609
c1.193,1.264,1.985,2.746,2.359,4.407c0.35,1.553,0.333,3.063-0.051,4.49c-0.707,2.635-2.27,4.654-4.643,6.007
c-1.473,0.837-3.111,1.264-4.876,1.269c-1.92,0-3.837,0-5.754,0h-7.479c-1.3,0-2.603,0-3.901,0
C17.368,39.327,16.067,39.33,14.765,39.33z M13.397,17.959c-0.509,0-0.995,0.062-1.446,0.187c-1.452,0.401-2.624,1.18-3.483,2.318
c-0.799,1.055-1.214,2.199-1.238,3.403c-0.016,0.815-0.296,1.253-1.029,1.62c-2.384,1.192-3.671,3.118-3.826,5.72
c-0.099,1.649,0.389,3.152,1.446,4.462c1.375,1.702,3.188,2.574,5.389,2.587c1.632,0.008,3.398,0.01,5.556,0.01
c1.302,0,2.602,0,3.902-0.002c1.301,0,2.603-0.003,3.904-0.003h7.478c1.917,0,3.834,0,5.752,0c1.577,0,3.042-0.381,4.352-1.131
c2.119-1.203,3.51-3.007,4.143-5.356c0.337-1.258,0.353-2.6,0.043-3.98c-0.332-1.476-1.039-2.789-2.095-3.913
c-1.017-1.078-2.248-1.862-3.659-2.329c-0.078-0.025-0.146-0.046-0.203-0.064c-0.622-0.19-0.729-0.436-0.723-1.031l0.002-0.102
c0-0.024-0.009-0.082-0.021-0.133c-0.012-0.063-0.022-0.125-0.03-0.187c-0.229-2.004-1.118-3.729-2.651-5.131
c-1.959-1.788-4.397-2.743-7.237-2.845c-1.7-0.058-3.333,0.213-4.84,0.811c-1.273,0.504-2.408,1.223-3.371,2.131
c-0.954,0.897-1.667,1.955-2.117,3.143c-0.18,0.469-0.519,0.537-0.706,0.537c-0.104,0-0.21-0.019-0.335-0.062
c-0.137-0.047-0.274-0.096-0.413-0.143c-0.511-0.183-0.993-0.354-1.479-0.429C14.095,17.987,13.739,17.959,13.397,17.959z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -1,3 +0,0 @@
- name: Api Documentation
href: api/
homepage: api/index.md

View File

@ -1,58 +0,0 @@
{
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/**.md",
"api/index.md"
]
},
{
"files": [
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default",
"templates/matthews"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false,
"globalMetadata": {
"_appTitle": "Azure SDK for C++",
"_appFooter": "Azure SDK for C++",
"_enableSearch": false,
"_enableNewTab": true,
"_appFaviconPath": "https://c.s-microsoft.com/favicon.ico?v2",
"_disableContribution": true
}
}
}

View File

@ -1,17 +0,0 @@
{{^_disableContribution}}
<div class="contribution-panel mobile-hide">
{{#docurl}}
<a href="{{docurl}}" title="{{__global.improveThisDoc}}" class="fab btn-warning pull-right"><i class="glyphicon glyphicon-pencil"></i></a>
{{/docurl}}
{{#sourceurl}}
<a href="{{sourceurl}}" title="{{__global.viewSource}}" class="fab btn-info pull-right"><i class="fa fa-code"></i></a>
{{/sourceurl}}
</div>
{{/_disableContribution}}
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
</nav>
</div>
</div>

View File

@ -1,100 +0,0 @@
<h1 id="{{id}}" data-uid="{{uid}}">{{>partials/title}}</h1>
<div class="markdown level0 summary">{{{summary}}}</div>
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
{{#inClass}}
<div class="inheritance">
<h5>{{__global.inheritance}}</h5>
{{#inheritance}}
<div class="level{{index}}">{{{specName.0.value}}}</div>
{{/inheritance}}
<div class="level{{level}}"><span class="xref">{{name.0.value}}</span></div>
</div>
{{/inClass}}
{{#derivedClasses}}
<div class="level{{index}}">{{{specName.0.value}}}</div>
{{/derivedClasses}}
{{#inheritedMembers.0}}
<div class="inheritedMembers">
<h5>{{__global.inheritedMembers}}</h5>
{{/inheritedMembers.0}}
{{#inheritedMembers}}
<div>
{{#definition}}
<xref uid="{{definition}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
{{/definition}}
{{^definition}}
<xref uid="{{uid}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
{{/definition}}
</div>
{{/inheritedMembers}}
{{#inheritedMembers.0}}
</div>
{{/inheritedMembers.0}}
<h6><strong>{{__global.namespace}}</strong>: {{{namespace.specName.0.value}}}</h6>
<h6><strong>{{__global.assembly}}</strong>: {{assemblies.0}}.dll</h6>
<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
</div>
{{#syntax.parameters.0}}
<h5 class="parameters">{{__global.parameters}}</h5>
<table>
{{/syntax.parameters.0}}
{{#syntax.parameters}}
<tr>
<td>
<span class="pull-right">{{{type.specName.0.value}}}</span>
<span class="parametername">{{{id}}}</span>
<p>{{{description}}}</p>
</td>
</tr>
{{/syntax.parameters}}
{{#syntax.parameters.0}}
</table>
{{/syntax.parameters.0}}
{{#syntax.return}}
<h5 class="returns">{{__global.returns}}</h5>
<table>
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
</table>
{{/syntax.return}}
{{#syntax.typeParameters.0}}
<h5 class="typeParameters">{{__global.typeParameters}}</h5>
<table>
{{/syntax.typeParameters.0}}
{{#syntax.typeParameters}}
<tr>
<td>
<span class="parametername">{{{id}}}</span>
<p>{{{description}}}</p>
</td>
</tr>
{{/syntax.typeParameters}}
{{#syntax.typeParameters.0}}
</table>
{{/syntax.typeParameters.0}}
{{#remarks}}
<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{/remarks}}
{{#example.0}}
<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
{{/example.0}}
{{#example}}
{{{.}}}
{{/example}}

View File

@ -1,210 +0,0 @@
{{>partials/class.header}}
{{#children}}
<h3 id="{{id}}">{{>partials/classSubtitle}}</h3>
{{#children}}
{{^_disableContribution}}
{{#docurl}}
<span class="small pull-right mobile-hide">
<span class="divider"> </span>
<a href="{{docurl}}" title="{{__global.improveThisDoc}}"><i class="fa fa-pencil"></i></a>
</span>
{{/docurl}}
{{#sourceurl}}
<span class="small pull-right mobile-hide">
<a href="{{sourceurl}}" title="{{__global.viewSource}}"><i class="fa fa-code"></i></a>
</span>
{{/sourceurl}}
{{/_disableContribution}}
{{#overload}}
<a id="{{id}}" data-uid="{{uid}}"></a>
{{/overload}}
<h4 id="{{id}}" data-uid="{{uid}}"><a href="#collapsible-{{id}}" class="expander" data-toggle="collapse">{{name.0.value}}</a></h4>
<div id="collapsible-{{id}}" class="collapse in">
<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>
{{/parameters.0}}
{{#parameters}}
<tr>
<td>
<span class="pull-right">{{{type.specName.0.value}}}</span>
<span class="parametername">{{{id}}}</span>
<p>{{{description}}}</p>
</td>
</tr>
{{/parameters}}
{{#parameters.0}}
</table>
{{/parameters.0}}
{{#return}}
<h5 class="returns">{{__global.returns}}</h5>
<table>
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
</table>
{{/return}}
{{#typeParameters.0}}
<h5 class="typeParameters">{{__global.typeParameters}}</h5>
<table>
{{/typeParameters.0}}
{{#typeParameters}}
<tr>
<td>
<span class="parametername">{{{id}}}</span>
<p>{{{description}}}</p>
</td>
</tr>
{{/typeParameters}}
{{#typeParameters.0}}
</table>
{{/typeParameters.0}}
{{#fieldValue}}
<h5 class="fieldValue">{{__global.fieldValue}}</h5>
<table>
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
</table>
{{/fieldValue}}
{{#propertyValue}}
<h5 class="propertyValue">{{__global.propertyValue}}</h5>
<table>
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
</table>
{{/propertyValue}}
{{#eventType}}
<h5 class="eventType">{{__global.eventType}}</h5>
<table>
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
</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>
{{/exceptions.0}}
{{#exceptions}}
<tr>
<td>
{{{type.specName.0.value}}}
<p>{{{description}}}</p>
</td>
</tr>
{{/exceptions}}
{{#exceptions.0}}
</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}}
</div>
{{/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

@ -1,24 +0,0 @@
{{>partials/class.header}}
{{#children}}
{{#children}}
<h4 id="{{id}}"><a href="#collapsible-{{id}}" class="expander" data-toggle="collapse">{{name.0.value}}</a></h4>
<div id="collapsible-{{id}}" class="collapse in">
<p>{{{summary}}}</p>
</div>
{{/children}}
{{/children}}
{{#extensionMethods.0}}
<h3 id="extensionmethods">{{__global.extensionMethods}}</h3>
{{/extensionMethods.0}}
{{#extensionMethods}}
<div>
{{#definition}}
<xref uid="{{definition}}" fullName="{{fullName.0.value}}" name="{{nameWithType.0.value}}"/>
{{/definition}}
{{^definition}}
<xref uid="{{uid}}" fullName="{{fullName.0.value}}" name="{{nameWithType.0.value}}"/>
{{/definition}}
</div>
{{/extensionMethods}}

View File

@ -1,17 +0,0 @@
<h1 id="{{id}}" data-uid="{{uid}}">{{>partials/title}}</h1>
<div class="markdown level0 summary">{{{summary}}}</div>
<div class="markdown level0 conceptual">{{{conceptual}}}</div>
<div class="markdown level0 remarks">{{{remarks}}}</div>
{{#children}}
<h3 id="{{id}}">{{>partials/namespaceSubtitle}}</h3>
<table>
{{#children}}
<tr>
<td>
<p><xref uid="{{uid}}" altProperty="fullName" displayProperty="name"/></p>
<p>{{{summary}}}</p>
</td>
</tr>
{{/children}}
</table>
{{/children}}

View File

@ -1,307 +0,0 @@
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css");
/* Clickability fix for selector on sm devices */
@media (min-width: 768px) and (max-width: 991px) {
article h1:first-of-type:before {
height: 0;
margin-top: 0;
}
}
#search {
border: none;
}
.fa-code {
font-size: 19px;
}
.sidetoc,
body .toc,
.sidefilter,
.sidetoggle {
background-color: #f9fbe7;
}
.sidenav,
.toc-toggle {
padding: 0;
}
.sidetoggle {
padding-bottom: 15px;
}
/* Remove center align from Navbar and Collapsible section */
.collapse.in,
.collapsing {
text-align: unset;
}
article h4 {
border-bottom: none;
line-height: normal;
}
@media (min-width: 768px) {
.sidetoc, .sidefilter {
margin-left: -15px;
}
}
@media (max-width: 767px) {
.navbar-collapse {
text-align: center !important;
}
.navbar-collapse li .active {
border-radius: 20px;
}
}
/* Collapsible Sections
------------------------------------------------------- */
.expander:after {
font-family: 'Glyphicons Halflings';
content: "\e260";
margin-left: 5px;
color: grey;
font-size: small;
}
.expander.collapsed:after {
content: "\e259";
}
/* Floating buttons
------------------------------------------------------- */
.fab {
width: 40px;
height: 40px;
text-align: center;
padding: 11px 0 0 0;
border: none;
outline: none;
color: #FFF;
border-radius: 100%;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
transition:.3s;
}
.fab:hover {
transform: scale(1.1);
}
.fab + .fab {
margin-right: 15px;
}
.contribution-panel {
z-index: 1000;
position: fixed;
right: 30px;
top: 70px;
}
/* Bootstrap docs like sidebar
------------------------------------------------------- */
.affix h5 {
display: none;
}
/* active & hover links */
.affix ul > li > a:hover,
.affix ul > li.active > a,
.affix ul > li > a:focus {
color: #563d7c;
text-decoration: none;
background-color: transparent;
border-left-color: #563d7c;
}
/* all active links */
.affix ul > li.active > a,
.affix ul > li.active:hover > a,
.affix ul > li.active:focus >a {
font-weight: 700;
}
/* nested active links */
.affix ul ul > li.active > a,
.affix ul ul > li.active:hover > a,
.affix ul ul > li.active:focus > a {
font-weight: 500;
}
/* all links */
.affix ul > li > a {
color: #999;
border-left: 2px solid transparent;
padding: 4px 20px;
font-size: 13px;
font-weight: 400;
}
/* nested links */
.affix ul ul > li > a {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 30px;
font-size: 12px;
}
/* hide inactive nested list */
.affix ul ul {
display: none;
}
/* show active nested list */
.affix ul > li.active > ul {
display: block;
}
.affix > ul > li > a:before {
content: '';
}
.affix ul ul > li > a:before {
content: '';
}
/* Style Buttons
------------------------------------------------------- */
.btn-warning {
background-color: #0071c5;
}
.btn-info {
background-color: #0071c5;
}
/* Navbar Hamburger
------------------------------------------------------- */
.icon-bar {
transition: 0.4s;
}
/* Rotate first bar */
.change .icon-bar:nth-of-type(2) {
transform: rotate(-45deg) translate(-4px, 5px) ;
}
/* Fade out the second bar */
.change .icon-bar:nth-of-type(3) {
opacity: 0;
}
/* Rotate last bar */
.change .icon-bar:nth-of-type(4) {
transform: rotate(45deg) translate(-4px, -5px) ;
}
/* Custom Navbar
------------------------------------------------------- */
.navbar-inverse {
background-color: #0071c5;
opacity: 0.95;
border-color: #0071c5;
}
.navbar-inverse .navbar-brand {
color: #ffffff;
}
.navbar-inverse .navbar-brand:hover,
.navbar-inverse .navbar-brand:focus {
color: #ecdbff;
}
.navbar-inverse .navbar-text {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
color: #ecdbff;
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus {
color: #ecdbff;
background-color: #0071c5;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
color: #ecdbff;
background-color: #0071c5;
}
.navbar-inverse .navbar-toggle {
border-color: #0071c5;
}
.navbar-inverse .navbar-toggle:hover,
.navbar-inverse .navbar-toggle:focus {
background-color: #0071c5;
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form {
border: none;
}
.navbar-inverse .navbar-link {
color: #ffffff;
}
.navbar-inverse .navbar-link:hover {
color: #ecdbff;
}
.versionarrow {
margin-left: 0.8em;
margin-top: -1.5em;
margin-bottom: -1em;
padding: 1em;
}
.versionarrow::before {
position: absolute;
content: '';
width: 0;
height: 0;
border: .5em solid transparent;
border-left-color: gray;
transform-origin: 0 50%;
transition: transform .1s;
margin-top: 0.2em;
}
.versionarrow.disable {
text-decoration: line-through;
}
.versionarrow.down::before {
transform: rotate(90deg);
margin-top: 0em;
transition: transform .1s;
}
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #ffffff;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ecdbff;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ecdbff;
background-color: #0071c5;
}
}
.navbar-version-select {
padding: 2px;
border: none;
border-radius: 2px;
box-shadow: none;
-webkit-appearance: media-time-remaining-display;
margin-top: 14px;
}

View File

@ -1,175 +0,0 @@
// Use container fluid
var containers = $(".container");
containers.removeClass("container");
containers.addClass("container-fluid");
WINDOW_CONTENTS = window.location.href.split('/');
SELECTED_LANGUAGE = 'cpp';
STORAGE_ACCOUNT_NAME = 'azuresdkdocs';
BLOB_URI_PREFIX = "https://" + STORAGE_ACCOUNT_NAME + ".blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/";
ATTR1 = '[<span class="hljs-meta">System.ComponentModel.EditorBrowsable</span>]\n<';
// Navbar Hamburger
$(function () {
$(".navbar-toggle").click(function () {
$(this).toggleClass("change");
})
})
// Select list to replace affix on small screens
$(function () {
var navItems = $(".sideaffix .level1 > li");
if (navItems.length == 0) {
return;
}
var selector = $("<select/>");
selector.addClass("form-control visible-sm visible-xs");
var form = $("<form/>");
form.append(selector);
form.prependTo("article");
selector.change(function () {
window.location = $(this).find("option:selected").val();
})
function work(item, level) {
var link = item.children('a');
var text = link.text();
for (var i = 0; i < level; ++i) {
text = '&nbsp;&nbsp;' + text;
}
selector.append($('<option/>', {
'value': link.attr('href'),
'html': text
}));
var nested = item.children('ul');
if (nested.length > 0) {
nested.children('li').each(function () {
work($(this), level + 1);
});
}
}
navItems.each(function () {
work($(this), 0);
});
})
function httpGetAsync(targetUrl, callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp.responseText);
}
xmlHttp.open("GET", targetUrl, true); // true for asynchronous
xmlHttp.send(null);
}
function populateOptions(selector, packageName) {
var versionRequestUrl = BLOB_URI_PREFIX + packageName + "/versioning/versions"
httpGetAsync(versionRequestUrl, function (responseText) {
var versionselector = document.createElement("select")
versionselector.className = 'navbar-version-select'
if (responseText) {
options = responseText.match(/[^\r\n]+/g)
for (var i in options) {
$(versionselector).append('<option value="' + options[i] + '">' + options[i] + '</option>')
}
}
$(versionselector).val(WINDOW_CONTENTS[6]);
$(selector).append(versionselector)
$(versionselector).change(function () {
targetVersion = $(this).val()
url = WINDOW_CONTENTS.slice()
url[6] = targetVersion
window.location.href = url.join('/')
});
})
}
function httpGetLatestAsync(targetUrl, latestVersions, packageName) {
httpGetAsync(targetUrl, function (responseText) {
if (responseText) {
version = responseText.match(/[^\r\n]+/g)
$(latestVersions).append('<li><a href="' + getPackageUrl(SELECTED_LANGUAGE, packageName, version) + '" target="_blank">' + version + '</a></li>')
}
})
}
function populateIndexList(selector, packageName) {
var url = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/versions"
var latestGAUrl = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/latest-ga"
var latestPreviewUrl = "https://azuresdkdocs.blob.core.windows.net/$web/" + SELECTED_LANGUAGE + "/" + packageName + "/versioning/latest-preview"
var latestVersions = document.createElement("ul")
httpGetLatestAsync(latestGAUrl, latestVersions, packageName)
httpGetLatestAsync(latestPreviewUrl, latestVersions, packageName)
var publishedVersions = $('<ul style="display: none;"></ul>')
var collapsible = $('<div class="versionarrow">&nbsp;&nbsp;&nbsp;Other versions</div>')
$(selector).after(latestVersions)
$(latestVersions).after(collapsible)
$(collapsible).after(publishedVersions)
// Add collapsible arrow on other versions.
$(collapsible).on('click', function(event) {
event.preventDefault();
if (collapsible.hasClass('disable')) {
return
}
$(this).toggleClass('down')
if ($(this).hasClass('down')) {
if (!$(selector).hasClass('loaded')){
httpGetAsync(url, function (responseText) {
if (responseText) {
options = responseText.match(/[^\r\n]+/g)
for (var i in options) {
$(publishedVersions).append('<li><a href="' + getPackageUrl(SELECTED_LANGUAGE, packageName, options[i]) + '" target="_blank">' + options[i] + '</a></li>')
}
}
else {
$(publishedVersions).append('<li>No discovered versions present in blob storage.</li>')
}
$(selector).addClass("loaded")
})
}
$(publishedVersions).show()
} else {
$(publishedVersions).hide()
}
});
}
function getPackageUrl(language, package, version) {
return "https://" + STORAGE_ACCOUNT_NAME + ".blob.core.windows.net/$web/" + language + "/" + package + "/" + version + "/index.html";
}
// Populate Versions
$(function () {
if (WINDOW_CONTENTS.length < 7 && WINDOW_CONTENTS[WINDOW_CONTENTS.length - 1] != 'index.html') {
console.log("Run PopulateList")
$('h4').each(function () {
var pkgName = $(this).text()
populateIndexList($(this), pkgName)
})
}
if (WINDOW_CONTENTS.length > 7) {
var pkgName = WINDOW_CONTENTS[5]
populateOptions($('#navbar'), pkgName)
}
})

View File

@ -1,72 +0,0 @@
jobs:
- job: GenerateDocIndex
pool:
vmImage: windows-2019
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
- pwsh: |
Invoke-WebRequest -MaximumRetryCount 10 -Uri "https://github.com/dotnet/docfx/releases/download/v2.43.2/docfx.zip" `
-OutFile "docfx.zip" | Wait-Process; Expand-Archive -Path "docfx.zip" -DestinationPath "./docfx/"
echo "##vso[task.setvariable variable=docfxPath]$(Build.BinariesDirectory)/docfx/docfx.exe"
workingDirectory: $(Build.BinariesDirectory)
displayName: Download and Extract DocFX
- task: PowerShell@2
displayName: "Generate Doc Index"
inputs:
pwsh: true
filePath: $(Build.SourcesDirectory)/eng/docs/index/Generate-DocIndex.ps1
arguments: >
-Docfx $(docfxPath)
-RepoRoot $(Build.SourcesDirectory)
-DocGenDir "$(Build.SourcesDirectory)/eng/docs/index"
-DocOutDir "$(Build.ArtifactStagingDirectory)/docfx_project"
-verbose
- task: UsePythonVersion@0
displayName: 'Use Python 3.6'
inputs:
versionSpec: '3.6'
- template: /eng/common/pipelines/templates/steps/mashup-doc-index.yml
parameters:
SourceDirectory: $(Build.ArtifactStagingDirectory)
- pwsh: |
Copy-Item -Path $(Build.SourcesDirectory)/eng/* -Destination ./ -Recurse -Force
echo "##vso[task.setvariable variable=toolPath]$(Build.BinariesDirectory)"
workingDirectory: $(Build.BinariesDirectory)
displayName: Move eng/common to Tool Directory
- task: PublishPipelineArtifact@0
condition: succeeded()
inputs:
artifactName: "Doc.Index"
targetPath: $(Build.ArtifactStagingDirectory)/docfx_project/_site
- pwsh: |
git checkout -b gh-pages-local --track origin/gh-pages-root
workingDirectory: $(Build.SourcesDirectory)
displayName: Git pull GH pages branch
- pwsh: |
Copy-Item -Path $(Build.ArtifactStagingDirectory)/docfx_project/_site/* -Destination ./ -Recurse -Force
git add -A
workingDirectory: $(Build.SourcesDirectory)
displayName: Copy the latest changes
- task: PowerShell@2
displayName: Push the Docs to GH-Pages
condition: succeeded()
inputs:
pwsh: true
workingDirectory: $(Build.SourcesDirectory)
filePath: $(toolPath)/common/scripts/git-branch-push.ps1
arguments: >
-PRBranchName "gh-pages"
-CommitMsg "Auto-generated docs from SHA(s) $(Build.SourceVersion)"
-GitUrl "https://$(azuresdk-github-pat)@github.com/$(Build.Repository.Name).git"
-PushArgs "--force"

View File

@ -48,6 +48,8 @@ function Publish-cpp-GithubIODocs ($DocLocation, $PublicArtifactLocation)
}
function Get-cpp-GithubIoDocIndex() {
# Update the main.js and docfx.json language content
UpdateDocIndexFiles -appTitleLang "C++"
# Fetch out all package metadata from csv file.
$metadata = Get-CSVMetadata -MetadataUri $MetadataUri
# Get the artifacts name from blob storage
@ -56,4 +58,4 @@ function Get-cpp-GithubIoDocIndex() {
$tocContent = Get-TocMapping -metadata $metadata -artifacts $artifacts
# Generate yml/md toc files and build site.
GenerateDocfxTocContent -tocContent $tocContent -lang "C++"
}
}