@microsoft/api-documenter
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "1.2.2", | ||
"tag": "@microsoft/api-documenter_v1.2.2", | ||
"date": "Thu, 24 May 2018 16:03:20 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Update API Set URL resolution in OfficeYamlDocumenter" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "1.2.1", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/api-documenter_v1.2.1", |
# Change Log - @microsoft/api-documenter | ||
This log was last generated on Tue, 15 May 2018 02:26:45 GMT and should not be manually modified. | ||
This log was last generated on Thu, 24 May 2018 16:03:20 GMT and should not be manually modified. | ||
## 1.2.2 | ||
Thu, 24 May 2018 16:03:20 GMT | ||
### Patches | ||
- Update API Set URL resolution in OfficeYamlDocumenter | ||
## 1.2.1 | ||
@@ -6,0 +13,0 @@ Tue, 15 May 2018 02:26:45 GMT |
@@ -10,2 +10,4 @@ import { DocItemSet } from '../utils/DocItemSet'; | ||
private _snippets; | ||
private _apiSetUrlDefault; | ||
private _apiSetUrls; | ||
constructor(docItemSet: DocItemSet, inputFolder: string); | ||
@@ -16,2 +18,3 @@ generateFiles(outputFolder: string): void; | ||
private _fixupApiSet(markup, uid); | ||
private _getApiSetUrl(uid); | ||
} |
@@ -16,2 +16,12 @@ "use strict"; | ||
super(docItemSet); | ||
// Default API Set URL when no product match is found. | ||
this._apiSetUrlDefault = '/javascript/office/javascript-api-for-office'; | ||
// Hash set of API Set URLs based on product. | ||
this._apiSetUrls = { | ||
'Excel': '/javascript/office/requirement-sets/excel-api-requirement-sets', | ||
'OneNote': '/javascript/office/requirement-sets/onenote-api-requirement-sets', | ||
'Visio': '/javascript/office/overview/visio-javascript-reference-overview', | ||
'Outlook': '/javascript/office/requirement-sets/outlook-api-requirement-sets', | ||
'Word': '/javascript/office/requirement-sets/word-api-requirement-sets' | ||
}; | ||
const snippetsFilePath = path.join(inputFolder, 'snippets.yaml'); | ||
@@ -69,20 +79,13 @@ console.log('Loading snippets from ' + snippetsFilePath); | ||
markup = markup.replace(/Api/, 'API'); | ||
if (uid.search(/Excel/i) !== -1) { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com?type=excel) \\]`); | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, '\\[ [$1](' + this._getApiSetUrl(uid) + ') \\]'); | ||
} | ||
// Gets the link to the API set based on product context. Seeks a case-insensitve match in the hash set. | ||
_getApiSetUrl(uid) { | ||
for (const key of Object.keys(this._apiSetUrls)) { | ||
const regexp = new RegExp(key, 'i'); | ||
if (regexp.test(uid)) { | ||
return this._apiSetUrls[key]; | ||
} | ||
} | ||
else if (uid.search(/OneNote/i) !== -1) { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com?type=onenote) \\]`); | ||
} | ||
else if (uid.search(/Visio/i) !== -1) { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com?type=visio) \\]`); | ||
} | ||
else if (uid.search(/Outlook/i) !== -1) { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com?type=outlook) \\]`); | ||
} | ||
else if (uid.search(/Word/i) !== -1) { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com?type=word) \\]`); | ||
} | ||
else { | ||
return markup.replace(/\\\[(API set:[^\]]+)\\\]/, `\\[ [$1](http://bing.com) \\]`); | ||
} | ||
return this._apiSetUrlDefault; // match not found. | ||
} | ||
@@ -89,0 +92,0 @@ } |
{ | ||
"name": "@microsoft/api-documenter", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Read JSON files from api-extractor, generate documentation pages", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273804
3518