Skip to content

Commit 21c4aad

Browse files
authored
Generate markdown tables for Preview APIs (#395)
* Automatically generate preview table * Fix include links * Adjust table header * Remove unused ExcelScript preview table * Fix links and HTML * Update to 0.6.0 versioned-d.ts-tools * Fix links again * Fix links again * Rename bad filename
1 parent fc5ec19 commit 21c4aad

File tree

27 files changed

+15962
-562
lines changed

27 files changed

+15962
-562
lines changed

docs/docs-ref-autogen/preview-apis.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Office Scripts preview APIs
33
description: Details about upcoming Office Scripts APIs.
44
ms.topic: whats-new
5-
ms.date: 08/26/2025
5+
ms.date: 09/08/2025
66
---
77

88
# Office Scripts preview APIs
@@ -22,23 +22,7 @@ The following table provides a concise summary of the APIs, while the subsequent
2222

2323
The following table lists the Office Scripts APIs currently in preview.
2424

25-
| Namespace | Class | Fields | Description |
26-
|:---|:---|:---|:---|
27-
| [OfficeScript](/javascript/api/office-scripts/officescript) | | [convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1)) | Return the text encoding of the document as a PDF. If the document is empty, then the following error is shown: "We didn't find anything to print". Some actions made prior to using this API may not be captured in the PDF in Excel on the web. |
28-
| | | [downloadFile({ name, content, })](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1)) | Downloads a specified file to the default download location specified by the local machine. |
29-
| | | [Metadata.getScriptName()](/javascript/api/office-scripts/officescript#officescript-officescript-metadata-getscriptname-function(1)) | Get the name of the currently running script. |
30-
| | | [saveCopyAs(filename)](/javascript/api/office-scripts/officescript#officescript-officescript-savecopyas-function(1)) | Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name. The API has a timeout limit of 30 seconds. This limit is rarely exceeded. |
31-
| | | [sendMail(mailProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-sendmail-function(1)) | Send an email with an Office Script. Use MailProperties to specify the content and recipients of the email. If the request body includes content, this method returns 400 Bad request. |
32-
| [OfficeScript](/javascript/api/office-scripts/officescript) | [EmailAttachment](/javascript/api/office-scripts/officescript/officescript.emailattachment) | [content](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-content-member) | The contents of the file. |
33-
| | | [name](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-name-member) | The text that is displayed below the icon representing the attachment. This string doesn't need to match the file name. |
34-
| [OfficeScript](/javascript/api/office-scripts/officescript) | [MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties) | [attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member) | A file (such as a text file or Excel workbook) attached to a message. Optional. |
35-
| | | [bcc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-bcc-member) | The blind carbon copy (BCC) recipient or recipients of the email. Optional. |
36-
| | | [cc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-cc-member) | The carbon copy (CC) recipient or recipients of the email. Optional. |
37-
| | | [content](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-content-member) | The content of the email. Optional. |
38-
| | | [contentType](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-contentType-member) | The type of the content in the email. Possible values are text or HTML. Optional. |
39-
| | | [importance](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-importance-member) | The importance of the email. The possible values are `low`, `normal`, and `high`. Default value is `normal`. Optional. |
40-
| | | [subject](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-subject-member) | The subject of the email. Optional. |
41-
| | | [to](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-to-member) | The direct recipient or recipients of the email. Optional. |
25+
[!INCLUDE[API table](../includes/officescript-preview.md)]
4226

4327
## See also
4428

docs/docs-ref-autogen/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ items:
33
items:
44
- name: API reference overview
55
href: overview.md
6+
- name: Preview APIs
7+
href: preview-apis.md
68
- name: ExcelScript
79
uid: ExcelScript!
810
items:
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| Class | Fields | Description |
2+
|:---|:---|:---|
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
| Class | Fields | Description |
2+
|:---|:---|:---|
3+
|*global*|[convertToPdf()](/javascript/api/office-scripts/officescript#officescript-officescript-converttopdf-function(1))|Return the text encoding of the document as a PDF.|
4+
||[downloadFile({ name, content, }: { name: string content: string })](/javascript/api/office-scripts/officescript#officescript-officescript-downloadfile-function(1))|Downloads a specified file to the default download location specified by the local machine.|
5+
||[getScriptName()](/javascript/api/office-scripts/officescript#officescript-officescript-getscriptname-function(1))|Get the name of the currently running script.|
6+
||[saveCopyAs(filename: string)](/javascript/api/office-scripts/officescript#officescript-officescript-savecopyas-function(1))|Saves a copy of the current workbook in OneDrive, in the same directory as the original file, with the specified file name.|
7+
||[sendMail(mailProperties: MailProperties)](/javascript/api/office-scripts/officescript#officescript-officescript-sendmail-function(1))|Send an email with an Office Script.|
8+
|[EmailAttachment](/javascript/api/office-scripts/officescript/officescript.emailattachment)|[content](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-content-member)|The contents of the file.|
9+
||[name](/javascript/api/office-scripts/officescript/officescript.emailattachment#officescript-officescript-emailattachment-name-member)|The text that is displayed below the icon representing the attachment.|
10+
|[MailProperties](/javascript/api/office-scripts/officescript/officescript.mailproperties)|[attachments](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-attachments-member)|A file (such as a text file or Excel workbook) attached to a message.|
11+
||[bcc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-bcc-member)|The blind carbon copy (BCC) recipient or recipients of the email.|
12+
||[cc](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-cc-member)|The carbon copy (CC) recipient or recipients of the email.|
13+
||[content](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-content-member)|The content of the email.|
14+
||[contentType](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-contenttype-member)|The type of the content in the email.|
15+
||[importance](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-importance-member)|The importance of the email.|
16+
||[subject](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-subject-member)|The subject of the email.|
17+
||[to](/javascript/api/office-scripts/officescript/officescript.mailproperties#officescript-officescript-mailproperties-to-member)|The direct recipient or recipients of the email.|

generate-docs/GenerateDocs.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ if [ -d "json" ]; then
1111
rm -rf "json"
1212
fi
1313

14-
mkdir json
14+
mkdir -p json/json-preview
15+
mkdir -p json/json-release
1516

1617
if [ -d "yaml" ]; then
1718
rm -rf "yaml"
1819
fi
1920

20-
mkdir yaml
21+
mkdir -p yaml/yaml-preview
22+
mkdir -p yaml/yaml-release
2123

2224
npm install
2325

@@ -27,6 +29,14 @@ npm run build
2729
node preprocessor.js
2830
popd
2931

32+
# Create release versions by removing @beta APIs
33+
./node_modules/.bin/version-remover api-extractor-inputs-excelscript/excelscript.d.ts api-extractor-inputs-excelscript-release/excelscript.d.ts "@beta"
34+
./node_modules/.bin/version-remover api-extractor-inputs-officescript/officescript.d.ts api-extractor-inputs-officescript-release/officescript.d.ts "@beta"
35+
36+
# Generate what's new reports comparing preview vs release
37+
./node_modules/.bin/whats-new api-extractor-inputs-excelscript/excelscript.d.ts api-extractor-inputs-excelscript-release/excelscript.d.ts ../docs/includes/excelscript-preview javascript/api/office-scripts/excelscript. office-scripts-link-config.json
38+
./node_modules/.bin/whats-new api-extractor-inputs-officescript/officescript.d.ts api-extractor-inputs-officescript-release/officescript.d.ts ../docs/includes/officescript-preview javascript/api/office-scripts/officescript. office-scripts-link-config.json
39+
3040
pushd api-extractor-inputs-excelscript
3141
../node_modules/.bin/api-extractor run
3242
popd
@@ -35,7 +45,16 @@ pushd api-extractor-inputs-officescript
3545
../node_modules/.bin/api-extractor run
3646
popd
3747

38-
./node_modules/.bin/api-documenter yaml --input-folder ./json --output-folder ./yaml --office
48+
pushd api-extractor-inputs-excelscript-release
49+
../node_modules/.bin/api-extractor run
50+
popd
51+
52+
pushd api-extractor-inputs-officescript-release
53+
../node_modules/.bin/api-extractor run
54+
popd
55+
56+
./node_modules/.bin/api-documenter yaml --input-folder ./json/json-preview --output-folder ./yaml/yaml-preview --office
57+
./node_modules/.bin/api-documenter yaml --input-folder ./json/json-release --output-folder ./yaml/yaml-release --office
3958

4059
pushd scripts
4160
node postprocessor.js
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3+
"mainEntryPointFilePath": "excelscript.d.ts",
4+
"apiReport": {
5+
"enabled": false
6+
},
7+
"docModel": {
8+
"enabled": true,
9+
"apiJsonFilePath": "../json/json-release/<unscopedPackageName>.api.json"
10+
},
11+
"dtsRollup": {
12+
"enabled": false
13+
},
14+
"messages": {
15+
"extractorMessageReporting": {
16+
"ae-missing-release-tag": {
17+
"logLevel": "none"
18+
},
19+
"ae-forgotten-export": {
20+
"logLevel": "none"
21+
}
22+
},
23+
"tsdocMessageReporting": {
24+
"tsdoc-escape-right-brace": {
25+
"logLevel": "none"
26+
},
27+
"tsdoc-escape-greater-than": {
28+
"logLevel": "none"
29+
},
30+
"tsdoc-malformed-inline-tag": {
31+
"logLevel": "none"
32+
},
33+
"tsdoc-unnecessary-backslash": {
34+
"logLevel": "none"
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)