Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add content-genration scenario sample #838

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 29 additions & 18 deletions playlists-prod/word.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,35 @@
group: Basics
api_set:
Selection: 1.1
- id: word-scenarios-content-generation
name: Content Generation
fileName: content-generation.yaml
description: >-
Insert predefined or AI-generated content to different locations of the
document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/content-generation.yaml
group: Scenarios
api_set:
WordApi: '1.5'
- id: word-scenarios-doc-assembly
name: Document assembly
fileName: doc-assembly.yaml
description: Composes different parts of a Word document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml
group: Scenarios
api_set:
WordApi: '1.1'
- id: word-scenarios-multiple-property-set
name: Set multiple properties at once
fileName: multiple-property-set.yaml
description: Sets multiple properties at once with the API object set() method.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/multiple-property-set.yaml
group: Scenarios
api_set:
WordApi: '1.3'
- id: word-content-controls-insert-and-change-content-controls
name: Content control basics
fileName: insert-and-change-content-controls.yaml
Expand Down Expand Up @@ -436,24 +465,6 @@
group: Document
api_set:
WordApi: '1.5'
- id: word-scenarios-doc-assembly
name: Document assembly
fileName: doc-assembly.yaml
description: Composes different parts of a Word document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml
group: Scenarios
api_set:
WordApi: '1.1'
- id: word-scenarios-multiple-property-set
name: Set multiple properties at once
fileName: multiple-property-set.yaml
description: Sets multiple properties at once with the API object set() method.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/multiple-property-set.yaml
group: Scenarios
api_set:
WordApi: '1.3'
- id: word-insert-and-get-pictures
name: Use inline pictures
fileName: insert-and-get-pictures.yaml
Expand Down
47 changes: 29 additions & 18 deletions playlists/word.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,35 @@
group: Basics
api_set:
Selection: 1.1
- id: word-scenarios-content-generation
name: Content Generation
fileName: content-generation.yaml
description: >-
Insert predefined or AI-generated content to different locations of the
document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/content-generation.yaml
group: Scenarios
api_set:
WordApi: '1.5'
- id: word-scenarios-doc-assembly
name: Document assembly
fileName: doc-assembly.yaml
description: Composes different parts of a Word document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/doc-assembly.yaml
group: Scenarios
api_set:
WordApi: '1.1'
- id: word-scenarios-multiple-property-set
name: Set multiple properties at once
fileName: multiple-property-set.yaml
description: Sets multiple properties at once with the API object set() method.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/multiple-property-set.yaml
group: Scenarios
api_set:
WordApi: '1.3'
- id: word-content-controls-insert-and-change-content-controls
name: Content control basics
fileName: insert-and-change-content-controls.yaml
Expand Down Expand Up @@ -436,24 +465,6 @@
group: Document
api_set:
WordApi: '1.5'
- id: word-scenarios-doc-assembly
name: Document assembly
fileName: doc-assembly.yaml
description: Composes different parts of a Word document.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/90-scenarios/doc-assembly.yaml
group: Scenarios
api_set:
WordApi: '1.1'
- id: word-scenarios-multiple-property-set
name: Set multiple properties at once
fileName: multiple-property-set.yaml
description: Sets multiple properties at once with the API object set() method.
rawUrl: >-
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/90-scenarios/multiple-property-set.yaml
group: Scenarios
api_set:
WordApi: '1.3'
- id: word-insert-and-get-pictures
name: Use inline pictures
fileName: insert-and-get-pictures.yaml
Expand Down
507 changes: 507 additions & 0 deletions samples/word/05-scenarios/content-generation.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 1
order: 2
id: word-scenarios-doc-assembly
name: Document assembly
description: Composes different parts of a Word document.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
order: 2
order: 3
id: word-scenarios-multiple-property-set
name: Set multiple properties at once
description: Sets multiple properties at once with the API object set() method.
Expand Down
12 changes: 6 additions & 6 deletions snippet-extractor-output/snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15320,7 +15320,7 @@
'Word.ContentControlCollection#getByTag:member(1)':
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml

await Word.run(async (context) => {
const contentControls = context.document.contentControls.getByTag("customer");
Expand Down Expand Up @@ -17071,7 +17071,7 @@
'Word.Paragraph#set:member(1)':
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/multiple-property-set.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/multiple-property-set.yaml

await Word.run(async (context) => {
const paragraph = context.document.body.paragraphs.getFirst();
Expand All @@ -17087,7 +17087,7 @@
});
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/multiple-property-set.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/multiple-property-set.yaml

await Word.run(async (context) => {
const firstParagraph = context.document.body.paragraphs.getFirst();
Expand Down Expand Up @@ -17201,7 +17201,7 @@
'Word.Paragraph#styleBuiltIn:member':
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml

await Word.run(async (context) => {
const paragraph = context.document.body.insertParagraph("Timeline", "End");
Expand Down Expand Up @@ -17537,7 +17537,7 @@
'Word.Range#insertContentControl:member(1)':
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml

// Simulates creation of a template. First searches the document for
instances of the string "Contractor",
Expand Down Expand Up @@ -17608,7 +17608,7 @@
'Word.Range#styleBuiltIn:member':
- >-
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml

await Word.run(async (context) => {
const header = context.document.body.insertText("This is a sample Heading 1 Title!!\n",
Expand Down
5 changes: 3 additions & 2 deletions view-prod/word.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"word-basics-basic-api-call": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/01-basics/basic-api-call.yaml",
"word-basics-api-call-es5": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/01-basics/basic-api-call-es5.yaml",
"word-basics-basic-common-api-call": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/01-basics/basic-common-api-call.yaml",
"word-scenarios-content-generation": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/content-generation.yaml",
"word-scenarios-doc-assembly": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/doc-assembly.yaml",
"word-scenarios-multiple-property-set": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/05-scenarios/multiple-property-set.yaml",
"word-content-controls-insert-and-change-content-controls": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/insert-and-change-content-controls.yaml",
"word-content-controls-content-control-onadded-event": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/content-control-onadded-event.yaml",
"word-content-controls-content-control-onentered-event": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/10-content-controls/content-control-onentered-event.yaml",
Expand Down Expand Up @@ -43,7 +46,5 @@
"word-document-manage-custom-xml-part": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-custom-xml-part.yaml",
"word-document-manage-styles": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-styles.yaml",
"word-document-save-close": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/save-close.yaml",
"word-scenarios-doc-assembly": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/doc-assembly.yaml",
"word-scenarios-multiple-property-set": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/90-scenarios/multiple-property-set.yaml",
"word-insert-and-get-pictures": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/insert-and-get-pictures.yaml"
}
5 changes: 3 additions & 2 deletions view/word.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"word-basics-basic-api-call": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/01-basics/basic-api-call.yaml",
"word-basics-api-call-es5": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/01-basics/basic-api-call-es5.yaml",
"word-basics-basic-common-api-call": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/01-basics/basic-common-api-call.yaml",
"word-scenarios-content-generation": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/content-generation.yaml",
"word-scenarios-doc-assembly": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/doc-assembly.yaml",
"word-scenarios-multiple-property-set": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/05-scenarios/multiple-property-set.yaml",
"word-content-controls-insert-and-change-content-controls": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/10-content-controls/insert-and-change-content-controls.yaml",
"word-content-controls-content-control-onadded-event": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/10-content-controls/content-control-onadded-event.yaml",
"word-content-controls-content-control-onentered-event": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/10-content-controls/content-control-onentered-event.yaml",
Expand Down Expand Up @@ -43,7 +46,5 @@
"word-document-manage-custom-xml-part": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/50-document/manage-custom-xml-part.yaml",
"word-document-manage-styles": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/50-document/manage-styles.yaml",
"word-document-save-close": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/50-document/save-close.yaml",
"word-scenarios-doc-assembly": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/90-scenarios/doc-assembly.yaml",
"word-scenarios-multiple-property-set": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/90-scenarios/multiple-property-set.yaml",
"word-insert-and-get-pictures": "https://raw.githubusercontent.com/OfficeDev/office-js-snippets/main/samples/word/99-preview-apis/insert-and-get-pictures.yaml"
}