-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
122 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,14 @@ title: Getting Started | |
--- | ||
|
||
1. Create a notebook in the [Wolfram Cloud](https://www.wolframcloud.com/) and make it public. | ||
* In the Cloud UI, use the "New Notebook" button and then use the "Share" dialog to make it public. | ||
* From the Wolfram Language, you could deploy notebook content like so: | ||
* In the cloud UI, use the New Notebook button and then use the Share dialog to make it public. | ||
* From the [Wolfram Language](https://www.wolfram.com/language/), you could deploy notebook content like so: | ||
|
||
```mathematica | ||
CloudDeploy[Manipulate[Plot[Sin[a * x], {x, 0, 2Pi}], {a, 1, 3}], | ||
Permissions -> {All -> {"Read", "Interact"}}] | ||
``` | ||
2. Install this library in your JS project using | ||
2. Install this library in your JavaScript project using | ||
```bash | ||
npm install wolfram-notebook-embedder | ||
|
@@ -28,14 +28,14 @@ title: Getting Started | |
```html | ||
<script crossorigin src="https://unpkg.com/[email protected]/dist/wolfram-notebook-embedder.min.js"></script> | ||
``` | ||
3. In your HTML, create a container where you want the notebook to be rendered (let's say `<div id="notebookContainer"></div>`) and add the following JS code: | ||
3. In your HTML, create a container where you want the notebook to be rendered (say `<div id="notebookContainer"></div>`) and add the following JS 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 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): | ||
```js | ||
embedding.then(function (nb) { | ||
|
@@ -51,4 +51,4 @@ 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). | ||
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. | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.