You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,15 @@ A collection of code snippets built with [Script Lab](//github.com/OfficeDev/scr
14
14
1. Clone your fork to your development computer.
15
15
1. Ensure that you have Node, version 6.10+, installed. (To check the version run the command `node -v`.)
16
16
1. Install `yarn` as a global package `npm install yarn --global`.
17
-
1. Be sure your CLI is in the root of the office-js-snippets repo and run `yarn install`. (It is similar to `npm install`.)
17
+
1. Be sure your CLI is in the root of the office-js-snippets repo and run `yarn install`. (It's similar to `npm install`.)
18
18
1. Set up the original \OfficeDev\office-js-snippets as the upstream repo for your local repo by following the steps in [Configuring a remote for a fork](https://help.github.com/articles/configuring-a-remote-for-a-fork/).
19
19
1. If you'll be using Visual Studio Code as your editor, install the [TSLint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) extension for Visual Studio Code.
20
20
21
21
### Adding a new sample
22
22
23
23
> For the git tasks in this procedure, the instructions assume that you're using a CLI. You are welcome to use a GUI git client. Consult the client's help to learn how to carry out the same tasks.
24
24
25
-
1. Create a snippet using [Script Lab](https://github.com/OfficeDev/script-lab/blob/master/README.md#what-is). Ensure that the name and description are what you want to be shown publicly. Use standard TypeScript indentation. Improper indentation can cause a failure of the build that you run in a later step. See also the [**Style guidelines**](#style-guidelines)section below.
25
+
1. Create a snippet using [Script Lab](https://github.com/OfficeDev/script-lab/blob/master/README.md#what-is). Ensure that the name and description are what you want to be shown publicly. Make sure to keep your snippet small. Use standard TypeScript indentation. Improper indentation can cause a failure of the build that you run in a later step. See also the [**Style guidelines**](#style-guidelines)and [**Size restrictions**](#size-restrictions) sections below.
26
26
1. Choose the Share icon, and then choose **Copy to Clipboard**.
27
27
1. Paste the contents into a text editor.
28
28
1. Near the top of the file, you will see the line `api_set: {}`. This needs to be changed to specify the host API version of the most recently added API that is used in your snippet. For example, if the snippet is for Excel and it uses some APIs that were introduced in Excel API 1.3, some in 1.4, and some in 1.5, then you need to specify `ExcelApi 1.5` as the value of the `api_set` property. Put a line break and four spaces before the value and no {} characters. To continue the example, when you're done the property would look like this:
@@ -130,6 +130,14 @@ A few style rules to observe:
130
130
- Don't forget the semicolons.
131
131
- `Libraries`in snippets must have a specific version. Eg. `[email protected]`.
132
132
133
+
## Size restrictions
134
+
135
+
Script Lab is designed for you to play with small code samples. Generally, a snippet should be at most a few hundred lines and a few thousand characters.
136
+
137
+
Your snippet can use hard-coded data. A small amount of data (say, a few hundred characters) is OK to hard code in Script Lab. However, for larger pieces of data, we recommend that you store those externally then load them at runtime with a command like `fetch`.
138
+
139
+
Keep your snippets and hard-coded data small since storing several large snippets could exceed Script Lab's storage and cause issues when loading Script Lab.
140
+
133
141
## Debugging the build script
134
142
135
143
- The scripts for building/validating the snippets are under the `config` folder -- in particular, under `build.ts`.
0 commit comments