@microsoft/api-documenter
Advanced tools
Comparing version
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "1.5.5", | ||
"tag": "@microsoft/api-documenter_v1.5.5", | ||
"date": "Wed, 01 Aug 2018 21:02:43 GMT", | ||
"comments": { | ||
"patch": [ | ||
{ | ||
"comment": "Updating OfficeYamlDocumenter to append snippets to non-empty sections" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "1.5.4", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/api-documenter_v1.5.4", |
# Change Log - @microsoft/api-documenter | ||
This log was last generated on Thu, 26 Jul 2018 23:53:43 GMT and should not be manually modified. | ||
This log was last generated on Wed, 01 Aug 2018 21:02:43 GMT and should not be manually modified. | ||
## 1.5.5 | ||
Wed, 01 Aug 2018 21:02:43 GMT | ||
### Patches | ||
- Updating OfficeYamlDocumenter to append snippets to non-empty sections | ||
## 1.5.4 | ||
@@ -6,0 +13,0 @@ Thu, 26 Jul 2018 23:53:43 GMT |
@@ -21,2 +21,3 @@ import { DocItemSet } from '../utils/DocItemSet'; | ||
private _fixEscapedCode(text); | ||
private _generateExampleSnippetText(snippets); | ||
} |
@@ -70,14 +70,15 @@ "use strict"; | ||
delete this._snippets[nameWithoutPackage]; | ||
if (!yamlItem.remarks) { | ||
yamlItem.remarks = ''; | ||
const snippetText = this._generateExampleSnippetText(snippets); | ||
if (yamlItem.remarks) { | ||
yamlItem.remarks += snippetText; | ||
} | ||
yamlItem.remarks += '\n\n#### Examples\n'; | ||
for (const snippet of snippets) { | ||
if (snippet.search(/await/) === -1) { | ||
yamlItem.remarks += '\n```javascript\n' + snippet + '\n```\n'; | ||
else if (yamlItem.syntax && yamlItem.syntax.return) { | ||
if (!yamlItem.syntax.return.description) { | ||
yamlItem.syntax.return.description = ''; | ||
} | ||
else { | ||
yamlItem.remarks += '\n```typescript\n' + snippet + '\n```\n'; | ||
} | ||
yamlItem.syntax.return.description += snippetText; | ||
} | ||
else { | ||
yamlItem.remarks = snippetText; | ||
} | ||
} | ||
@@ -122,2 +123,16 @@ } | ||
} | ||
_generateExampleSnippetText(snippets) { | ||
const text = ['\n#### Examples\n']; | ||
for (const snippet of snippets) { | ||
if (snippet.search(/await/) === -1) { | ||
text.push('```javascript'); | ||
} | ||
else { | ||
text.push('```typescript'); | ||
} | ||
text.push(snippet); | ||
text.push('```'); | ||
} | ||
return text.join('\n'); | ||
} | ||
} | ||
@@ -124,0 +139,0 @@ exports.OfficeYamlDocumenter = OfficeYamlDocumenter; |
{ | ||
"name": "@microsoft/api-documenter", | ||
"version": "1.5.4", | ||
"version": "1.5.5", | ||
"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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
303442
0.67%3978
0.71%