From 657e5b6a0611bdf9dbde6c46cef21430c2be63da Mon Sep 17 00:00:00 2001 From: Jan Poeschko Date: Fri, 26 Jul 2019 13:16:49 +0200 Subject: [PATCH] spell out "JavaScript" (instead of "JS") on all documentation pages --- README.md | 2 +- docs/GettingStarted.md | 8 ++++---- docs/LibraryInterface.md | 2 +- docs/NotebookAPI.md | 4 ++-- docs/NotebookLoadingPhases.md | 4 ++-- docs/ServerSideRendering.md | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7592a23..309d053 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ If you are using a package manager such as [npm](https://www.npmjs.com/get-npm) npm install wolfram-notebook-embedder -and then import it in your JS code like so: +and then import it in your JavaScript code like so: import WolframNotebookEmbedder from 'wolfram-notebook-embedder'; diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index a8684ca..5eca4e8 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -17,7 +17,7 @@ title: Getting Started npm install wolfram-notebook-embedder ``` - so you can import it in JS as + so you can import it in JavaScript as ```js import WolframNotebookEmbedder from 'wolfram-notebook-embedder'; @@ -28,14 +28,14 @@ title: Getting Started ```html ``` -3. In your HTML, create a container where you want the notebook to be rendered (say `
`) and add the following JS code: +3. In your HTML, create a container where you want the notebook to be rendered (say `
`) and add the following JavaScript code: ```js var embedding = WolframNotebookEmbedder.embed('url', document.getElementById('notebookContainer')); ``` where `url` is the URL of your cloud object from step 1. More details about `embed` are described in the [library interface documentation](./LibraryInterface.md). -4. If you want to control the notebook from your JS code, wait for the `embed` result (a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)) to resolve, and then use various [Notebook API methods](./NotebookAPI.md): +4. If you want to control the notebook from your JavaScript code, wait for the `embed` result (a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises)) to resolve, and then use various [Notebook API methods](./NotebookAPI.md): ```js embedding.then(function (nb) { @@ -50,5 +50,5 @@ title: Getting Started }); }) ``` -5. If you want to serve static HTML from your server so the notebook can be rendered before JS code is loaded (which also helps with SEO), take a look at [server-side rendering](./ServerSideRendering.md). +5. If you want to serve static HTML from your server so the notebook can be rendered before JavaScript code is loaded (which also helps with SEO), take a look at [server-side rendering](./ServerSideRendering.md). 6. If you run into any issues, take a look at the [troubleshooting guide](./Troubleshooting.md). If you think you found a bug, please report it. diff --git a/docs/LibraryInterface.md b/docs/LibraryInterface.md index a40b3b9..ac456de 100644 --- a/docs/LibraryInterface.md +++ b/docs/LibraryInterface.md @@ -11,7 +11,7 @@ WolframNotebookEmbedder.embed(notebookURL, domNode, attributes) * `notebookURL`: a string with a cloud object URL of the notebook to embed, e.g. `'https://www.wolframcloud.com/obj/4beadfbb-84dd-4b26-87b6-bcd30b9abd65'` or `'https://www.wolframcloud.com/obj/myusername/myfolder/mynotebook.nb'` * `domNode`: a DOM node in which to render the notebook, e.g. obtained by `document.getElementById('myContainer')` -* `attributes `: a JS object with attributes +* `attributes `: a JavaScript object with attributes The following attributes can be given: diff --git a/docs/NotebookAPI.md b/docs/NotebookAPI.md index 2454689..26b75ac 100644 --- a/docs/NotebookAPI.md +++ b/docs/NotebookAPI.md @@ -3,9 +3,9 @@ id: NotebookAPI title: Notebook API --- -This is the documentation of [methods](#methods) on the object returned by [`embed`](./LibraryInterface.md) to control a notebook from JS code. Each method takes a JS object with *parameters* and returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) resolving to a *response* object. Parameters with a default value (specified as "= `...`") are optional. In case of an error, the returned promise is rejected with a standard [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object with a `message` property; the potential error messages are listed for each command. +This is the documentation of [methods](#methods) on the object returned by [`embed`](./LibraryInterface.md) to control a notebook from JavaScript code. Each method takes a JavaScript object with *parameters* and returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) resolving to a *response* object. Parameters with a default value (specified as "= `...`") are optional. In case of an error, the returned promise is rejected with a standard [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object with a `message` property; the potential error messages are listed for each command. -The API also exposes some [events](#events) that can be subscribed to using the API method `addEventListener(eventName, callback)`. The `callback` will receive a JS object with the specified *fields* as its single argument. Event listeners can be removed with `removeEventListener(eventName, callback)`. Some events are marked as *singular*, which means that they will usually fire exactly once, and an event listener added after they have already fired will still be executed (right away). +The API also exposes some [events](#events) that can be subscribed to using the API method `addEventListener(eventName, callback)`. The `callback` will receive a JavaScript object with the specified *fields* as its single argument. Event listeners can be removed with `removeEventListener(eventName, callback)`. Some events are marked as *singular*, which means that they will usually fire exactly once, and an event listener added after they have already fired will still be executed (right away). ## Methods diff --git a/docs/NotebookLoadingPhases.md b/docs/NotebookLoadingPhases.md index 9ea106c..d1ee3d9 100644 --- a/docs/NotebookLoadingPhases.md +++ b/docs/NotebookLoadingPhases.md @@ -5,11 +5,11 @@ title: Notebook Loading Phases ## Rendering phases -Notebooks depend on various things that are loaded asynchronously, e.g. the actual notebook content, CSS, JS, fonts and (potentially) results from kernel evaluations. While things are loading, static pieces of HTML are rendered if available (see [server-side rendering](./ServerSideRendering.md)). Rendering generally goes through the following phases: +Notebooks depend on various things that are loaded asynchronously, e.g. the actual notebook content, CSS, JavaScript, fonts and (potentially) results from kernel evaluations. While things are loading, static pieces of HTML are rendered if available (see [server-side rendering](./ServerSideRendering.md)). Rendering generally goes through the following phases: 1. Nothing is displayed initially. 2. Once critical CSS and fonts are loaded: Static HTML is displayed, if available; the event `first-paint-done` with `{showingStaticHTML: true}` is fired. -3. Once the main JS code and notebook content data is loaded: Static HTML is reused as a whole (albeit in a slightly different container structure); the event `initial-render-progress` with `{cellsRendered: 0, cellsTotal: -1}` is fired. +3. Once the main JavaScript code and notebook content data is loaded: Static HTML is reused as a whole (albeit in a slightly different container structure); the event `initial-render-progress` with `{cellsRendered: 0, cellsTotal: -1}` is fired. 4. Once other dependencies, such as the notebook stylesheet, are loaded and notebook-level options are resolved (possibly relying on kernel evaluations): Static HTML for individual cells is rendered; the event `initial-render-progress` with `{cellsRendered: 0, cellsTotal: N}` is fired with the actual number `N` of initially visible cells. If no static HTML was available initially, the event `first-paint-done` is fired at this point. The notebook also starts fetching static HTML for cells that were not present in the initial static HTML. 5. Each cell might require additional dependencies (e.g. fonts), resolution of `Dynamic` option values, resolution of `Dynamic` content, etc. Once a cell becomes ready, it is "live-rendered", while other non-ready cells are still rendered using static HTML; the event `initial-render-progress` with `{cellsRendered: M, cellsTotal: N}` is fired accordingly. 6. Once all cells have been live-rendered: The event `initial-render-done` is fired. diff --git a/docs/ServerSideRendering.md b/docs/ServerSideRendering.md index ba6e265..6b7f5e0 100644 --- a/docs/ServerSideRendering.md +++ b/docs/ServerSideRendering.md @@ -3,7 +3,7 @@ id: ServerSideRendering title: Server-Side Rendering --- -In some cases, you might want to include (static) HTML for a notebook on your page so it can be rendered even before the necessary JavaScript code is loaded and executed. This reduces the time until the user sees the notebook, and it also helps search engines to index your notebook content. Once your JS code executes, you can [embed](./LibraryInterface.md) the notebook into the same container node, and it will transition seamlessly from the static view to "live" (interactive) rendering. The same happens on [www.wolframcloud.com](https://www.wolframcloud.com) as well. +In some cases, you might want to include (static) HTML for a notebook on your page so it can be rendered even before the necessary JavaScript code is loaded and executed. This reduces the time until the user sees the notebook, and it also helps search engines to index your notebook content. Once your JavaScript code executes, you can [embed](./LibraryInterface.md) the notebook into the same container node, and it will transition seamlessly from the static view to "live" (interactive) rendering. The same happens on [www.wolframcloud.com](https://www.wolframcloud.com) as well. Static HTML is generated ("pre-rendered") for each cloud notebook whenever it is created or changed. You can access it through an HTTP API, by making a `GET` request to