Commit cf2eeaa
[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
- docs/docs-ref-autogen
- excelscript
- officescript
- generate-docs/scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
10 | 20 | | |
11 | 21 | | |
| 22 | + | |
12 | 23 | | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
| 36 | + | |
24 | 37 | | |
25 | 38 | | |
26 | 39 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
12 | 21 | | |
13 | 22 | | |
| 23 | + | |
14 | 24 | | |
| 25 | + | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
| |||
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| 46 | + | |
35 | 47 | | |
36 | 48 | | |
37 | 49 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
| 24 | + | |
12 | 25 | | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | 29 | | |
| |||
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
| 24 | + | |
12 | 25 | | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | 29 | | |
| |||
33 | 47 | | |
34 | 48 | | |
35 | 49 | | |
| 50 | + | |
36 | 51 | | |
37 | 52 | | |
38 | 53 | | |
| |||
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
10 | 22 | | |
11 | 23 | | |
| 24 | + | |
12 | 25 | | |
| 26 | + | |
13 | 27 | | |
14 | 28 | | |
15 | 29 | | |
| |||
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| |||
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
| 21 | + | |
12 | 22 | | |
| 23 | + | |
13 | 24 | | |
14 | 25 | | |
15 | 26 | | |
| |||
25 | 36 | | |
26 | 37 | | |
27 | 38 | | |
| 39 | + | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| |||
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
12 | 25 | | |
13 | 26 | | |
| 27 | + | |
14 | 28 | | |
| 29 | + | |
15 | 30 | | |
16 | 31 | | |
17 | 32 | | |
| |||
30 | 45 | | |
31 | 46 | | |
32 | 47 | | |
| 48 | + | |
33 | 49 | | |
34 | 50 | | |
35 | 51 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
| 23 | + | |
12 | 24 | | |
| 25 | + | |
13 | 26 | | |
14 | 27 | | |
15 | 28 | | |
| |||
42 | 55 | | |
43 | 56 | | |
44 | 57 | | |
| 58 | + | |
45 | 59 | | |
46 | 60 | | |
47 | 61 | | |
| |||
0 commit comments