Skip to content

Commit cf2eeaa

Browse files
AlexJerabekCopilot
andauthored
[scripts] Add 'Used by' sections to API reference pages (#428)
* Add 'Used by' sections to API reference pages Adds a reverse-reference index built from the API Extractor JSON output. Every type that is used as a property type, return type, or parameter type by another API member now gets a '#### Used by' section in its remarks. The section groups callers by containing class and links to both the class page and the specific member, helping readers understand the object model and navigate between related pages. Implementation details: - buildUsedByIndex() reads json-preview/ExcelScript.api.json and OfficeScript.api.json to build a reverse map of typeUID -> callers - analyzeMembers/analyzeMemberTypeReferences/analyzeExcerptTokens walk the API JSON extracting Reference tokens from property, return, and parameter type token ranges - injectUsedBySection() filters self-references, deduplicates method overloads, and injects the section into each YAML item's remarks - Enum fields are excluded (OPS does not support remarks on enum fields) - URLs follow the /javascript/api/office-scripts/<pkg>/<class>#<anchor> pattern already used in this repo Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix namespace-level function URLs in 'Used by' sections Namespace-level functions (e.g., OfficeScript.downloadFile, OfficeScript.sendMail) live on the package page, not a class subpage. When the classPath equals the package name, the correct URL is /javascript/api/office-scripts/<pkg> rather than /javascript/api/office-scripts/<pkg>/<pkg>. Added isNamespace check to both convertUidToUrl() and the classUrl calculation in generateUsedBySection(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Rerun GenerateDocs --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bf3c9ce commit cf2eeaa

312 files changed

Lines changed: 4495 additions & 322 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/docs-ref-autogen/excelscript/excelscript.aggregationfunction.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,24 @@ uid: ExcelScript!ExcelScript.AggregationFunction:enum
44
package: ExcelScript!
55
fullName: ExcelScript.AggregationFunction
66
summary: Aggregation function for the `DataPivotHierarchy`<!-- -->.
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.DataPivotHierarchy](/javascript/api/office-scripts/excelscript/excelscript.datapivothierarchy):
17+
[getSummarizeBy](/javascript/api/office-scripts/excelscript/excelscript.datapivothierarchy#excelscript-excelscript-datapivothierarchy-getsummarizeby-member(1)),
18+
[setSummarizeBy](/javascript/api/office-scripts/excelscript/excelscript.datapivothierarchy#excelscript-excelscript-datapivothierarchy-setsummarizeby-member(1))
19+
1020
#### Examples
1121
22+
1223
```TypeScript
24+
1325
/**
1426
* This script changes how the data in a PivotTable is aggregated.
1527
*/
@@ -21,6 +33,7 @@ remarks: |-
2133
const dataHierarchy = pivotTable.getDataHierarchies()[0];
2234
dataHierarchy.setSummarizeBy(ExcelScript.AggregationFunction.average);
2335
}
36+
2437
```
2538
2639
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.alloweditrange.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ summary: >-
88
with worksheet protection properties. When worksheet protection is enabled, an
99
`AllowEditRange` object can be used to allow editing of a specific range,
1010
while maintaining protection on the rest of the worksheet.
11-
remarks: ''
11+
remarks: >-
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.WorksheetProtection](/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection):
17+
[getAllowEditRange](/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection#excelscript-excelscript-worksheetprotection-getalloweditrange-member(1)),
18+
[getAllowEditRanges](/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection#excelscript-excelscript-worksheetprotection-getalloweditranges-member(1))
1219
1320
isPreview: false
1421
isDeprecated: false

docs/docs-ref-autogen/excelscript/excelscript.alloweditrangeoptions.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ fullName: ExcelScript.AllowEditRangeOptions
66
summary: >-
77
The interface used to construct optional fields of the `AllowEditRange`
88
object.
9-
remarks: |-
9+
remarks: >-
1010
1111
12+
13+
14+
#### Used by
15+
16+
17+
-
18+
[ExcelScript.WorksheetProtection](/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection):
19+
[addAllowEditRange](/javascript/api/office-scripts/excelscript/excelscript.worksheetprotection#excelscript-excelscript-worksheetprotection-addalloweditrange-member(1))
20+
1221
#### Examples
1322
23+
1424
```TypeScript
25+
1526
/**
1627
* This script adds a password-protected, editable range
1728
* to an otherwise protected worksheet.
@@ -32,6 +43,7 @@ remarks: |-
3243
// Protect the worksheet.
3344
sheetProtection.protect();
3445
}
46+
3547
```
3648
3749
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.application.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ uid: ExcelScript!ExcelScript.Application:interface
44
package: ExcelScript!
55
fullName: ExcelScript.Application
66
summary: Represents the Excel application that manages the workbook.
7-
remarks: ''
7+
remarks: >-
8+
#### Used by
9+
10+
11+
-
12+
[ExcelScript.Workbook](/javascript/api/office-scripts/excelscript/excelscript.workbook):
13+
[getApplication](/javascript/api/office-scripts/excelscript/excelscript.workbook#excelscript-excelscript-workbook-getapplication-member(1))
814
915
isPreview: false
1016
isDeprecated: false

docs/docs-ref-autogen/excelscript/excelscript.arrowheadlength.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ uid: ExcelScript!ExcelScript.ArrowheadLength:enum
44
package: ExcelScript!
55
fullName: ExcelScript.ArrowheadLength
66
summary: ''
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.Line](/javascript/api/office-scripts/excelscript/excelscript.line):
17+
[getBeginArrowheadLength](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getbeginarrowheadlength-member(1)),
18+
[getEndArrowheadLength](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getendarrowheadlength-member(1)),
19+
[setBeginArrowheadLength](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setbeginarrowheadlength-member(1)),
20+
[setEndArrowheadLength](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setendarrowheadlength-member(1))
21+
1022
#### Examples
1123
24+
1225
```TypeScript
26+
1327
/**
1428
* This script adds a line that goes from cell B2 to cell F4 on the current worksheet.
1529
*/
@@ -34,6 +48,7 @@ remarks: |-
3448
line.setEndArrowheadStyle(ExcelScript.ArrowheadStyle.open);
3549
line.setEndArrowheadLength(ExcelScript.ArrowheadLength.long);
3650
}
51+
3752
```
3853
3954
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.arrowheadstyle.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ uid: ExcelScript!ExcelScript.ArrowheadStyle:enum
44
package: ExcelScript!
55
fullName: ExcelScript.ArrowheadStyle
66
summary: ''
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.Line](/javascript/api/office-scripts/excelscript/excelscript.line):
17+
[getBeginArrowheadStyle](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getbeginarrowheadstyle-member(1)),
18+
[getEndArrowheadStyle](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getendarrowheadstyle-member(1)),
19+
[setBeginArrowheadStyle](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setbeginarrowheadstyle-member(1)),
20+
[setEndArrowheadStyle](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setendarrowheadstyle-member(1))
21+
1022
#### Examples
1123
24+
1225
```TypeScript
26+
1327
/**
1428
* This script adds a line that goes from cell B2 to cell F4 on the current worksheet.
1529
*/
@@ -33,6 +47,7 @@ remarks: |-
3347
const line = newShape.getLine();
3448
line.setEndArrowheadStyle(ExcelScript.ArrowheadStyle.open);
3549
}
50+
3651
```
3752
3853
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.arrowheadwidth.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ uid: ExcelScript!ExcelScript.ArrowheadWidth:enum
44
package: ExcelScript!
55
fullName: ExcelScript.ArrowheadWidth
66
summary: ''
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.Line](/javascript/api/office-scripts/excelscript/excelscript.line):
17+
[getBeginArrowheadWidth](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getbeginarrowheadwidth-member(1)),
18+
[getEndArrowheadWidth](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-getendarrowheadwidth-member(1)),
19+
[setBeginArrowheadWidth](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setbeginarrowheadwidth-member(1)),
20+
[setEndArrowheadWidth](/javascript/api/office-scripts/excelscript/excelscript.line#excelscript-excelscript-line-setendarrowheadwidth-member(1))
21+
1022
#### Examples
1123
24+
1225
```TypeScript
26+
1327
/**
1428
* This script adds a line that goes from cell B2 to cell F4 on the current worksheet.
1529
*/
@@ -34,6 +48,7 @@ remarks: |-
3448
line.setEndArrowheadStyle(ExcelScript.ArrowheadStyle.triangle);
3549
line.setEndArrowheadWidth(ExcelScript.ArrowheadWidth.wide);
3650
}
51+
3752
```
3853
3954
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.autofilltype.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,23 @@ uid: ExcelScript!ExcelScript.AutoFillType:enum
44
package: ExcelScript!
55
fullName: ExcelScript.AutoFillType
66
summary: The behavior types when AutoFill is used on a range in the workbook.
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.Range](/javascript/api/office-scripts/excelscript/excelscript.range):
17+
[autoFill](/javascript/api/office-scripts/excelscript/excelscript.range#excelscript-excelscript-range-autofill-member(1))
18+
1019
#### Examples
1120
21+
1222
```TypeScript
23+
1324
/**
1425
* This script uses the autofill feature to complete a table with days of the month.
1526
* See https://support.microsoft.com/office/74e31bdd-d993-45da-aa82-35a236c5b5db
@@ -25,6 +36,7 @@ remarks: |-
2536
// Autofill the connected range. C2:C3 are filled in with dates. C4:C54 are blank.
2637
dataRange.autoFill("C2:C54", ExcelScript.AutoFillType.fillDays);
2738
}
39+
2840
```
2941
3042
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.autofilter.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,27 @@ fullName: ExcelScript.AutoFilter
66
summary: >-
77
Represents the `AutoFilter` object. AutoFilter turns the values in Excel
88
column into specific filters based on the cell contents.
9-
remarks: |-
9+
remarks: >-
1010
1111
12+
13+
14+
#### Used by
15+
16+
17+
-
18+
[ExcelScript.Table](/javascript/api/office-scripts/excelscript/excelscript.table):
19+
[getAutoFilter](/javascript/api/office-scripts/excelscript/excelscript.table#excelscript-excelscript-table-getautofilter-member(1))
20+
21+
-
22+
[ExcelScript.Worksheet](/javascript/api/office-scripts/excelscript/excelscript.worksheet):
23+
[getAutoFilter](/javascript/api/office-scripts/excelscript/excelscript.worksheet#excelscript-excelscript-worksheet-getautofilter-member(1))
24+
1225
#### Examples
1326
27+
1428
```TypeScript
29+
1530
/**
1631
* This script creates an autoFilter on the worksheet that filters out rows based on column values.
1732
* The autoFilter filters to only include rows that have a value in column C in the lowest 10 values
@@ -30,6 +45,7 @@ remarks: |-
3045
filterOn: ExcelScript.FilterOn.bottomItems
3146
});
3247
}
48+
3349
```
3450
3551
isPreview: false

docs/docs-ref-autogen/excelscript/excelscript.basicdatavalidation.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,25 @@ uid: ExcelScript!ExcelScript.BasicDataValidation:interface
44
package: ExcelScript!
55
fullName: ExcelScript.BasicDataValidation
66
summary: Represents the basic type data validation criteria.
7-
remarks: |-
7+
remarks: >-
88
99
10+
11+
12+
#### Used by
13+
14+
15+
-
16+
[ExcelScript.DataValidationRule](/javascript/api/office-scripts/excelscript/excelscript.datavalidationrule):
17+
[decimal](/javascript/api/office-scripts/excelscript/excelscript.datavalidationrule#excelscript-excelscript-datavalidationrule-decimal-member),
18+
[textLength](/javascript/api/office-scripts/excelscript/excelscript.datavalidationrule#excelscript-excelscript-datavalidationrule-textlength-member),
19+
[wholeNumber](/javascript/api/office-scripts/excelscript/excelscript.datavalidationrule#excelscript-excelscript-datavalidationrule-wholenumber-member)
20+
1021
#### Examples
1122
23+
1224
```TypeScript
25+
1326
/**
1427
* This script creates a data validation rule for the range B1:B5.
1528
* All values in that range must be a positive number.
@@ -42,6 +55,7 @@ remarks: |-
4255
};
4356
rangeDataValidation.setErrorAlert(positiveNumberOnlyAlert);
4457
}
58+
4559
```
4660
4761
isPreview: false

0 commit comments

Comments
 (0)