aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/apidocs/output/page.ts3
-rw-r--r--scripts/apidocs/processing/jsdocs.ts4
-rw-r--r--scripts/apidocs/processing/signature.ts6
3 files changed, 13 insertions, 0 deletions
diff --git a/scripts/apidocs/output/page.ts b/scripts/apidocs/output/page.ts
index a9570309..e557454d 100644
--- a/scripts/apidocs/output/page.ts
+++ b/scripts/apidocs/output/page.ts
@@ -137,6 +137,7 @@ async function toMethodData(method: RawApiDocsMethod): Promise<ApiDocsMethod> {
description,
since,
parameters,
+ remarks,
returns,
throws,
signature,
@@ -158,6 +159,7 @@ async function toMethodData(method: RawApiDocsMethod): Promise<ApiDocsMethod> {
name,
deprecated: mdToHtml(deprecated),
description: mdToHtml(description),
+ remark: remarks.length === 0 ? undefined : mdToHtml(remarks.join('\n')),
since,
parameters: parameters.map((param) => ({
...param,
@@ -178,6 +180,7 @@ async function toMethodData(method: RawApiDocsMethod): Promise<ApiDocsMethod> {
return {
name,
description: mdToHtml(description),
+ remark: remarks.length === 0 ? undefined : mdToHtml(remarks.join('\n')),
parameters: parameters.map((param) => ({
...param,
type: param.type.text,
diff --git a/scripts/apidocs/processing/jsdocs.ts b/scripts/apidocs/processing/jsdocs.ts
index 41c1b84a..55dea867 100644
--- a/scripts/apidocs/processing/jsdocs.ts
+++ b/scripts/apidocs/processing/jsdocs.ts
@@ -69,6 +69,10 @@ export function getSeeAlsos(jsdocs: JSDoc): string[] {
return getTagsFromJSDoc(jsdocs, 'see', true);
}
+export function getRemarks(jsdocs: JSDoc): string[] {
+ return getTagsFromJSDoc(jsdocs, 'remark');
+}
+
function getOptionalTagFromJSDoc(
jsdocs: JSDoc,
type: string
diff --git a/scripts/apidocs/processing/signature.ts b/scripts/apidocs/processing/signature.ts
index c7ae872b..8f6cedcb 100644
--- a/scripts/apidocs/processing/signature.ts
+++ b/scripts/apidocs/processing/signature.ts
@@ -8,6 +8,7 @@ import {
getDescription,
getExamples,
getJsDocs,
+ getRemarks,
getSeeAlsos,
getSince,
getThrows,
@@ -39,6 +40,10 @@ export interface RawApiDocsSignature {
*/
parameters: RawApiDocsParameter[];
/**
+ * Additional comments of the signature that are supposed to stand out from the description.
+ */
+ remarks: string[];
+ /**
* The return type of the signature.
*/
returns: RawApiDocsType;
@@ -107,6 +112,7 @@ function processSignature(
description: getDescription(jsdocs),
since: getSince(jsdocs),
parameters,
+ remarks: getRemarks(jsdocs),
returns,
throws: getThrows(jsdocs),
signature: getSignatureText(signature),