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

notebookContent not show with local resource #5

Open
futurepaycc opened this issue Jul 4, 2021 · 4 comments
Open

notebookContent not show with local resource #5

futurepaycc opened this issue Jul 4, 2021 · 4 comments

Comments

@futurepaycc
Copy link

try to replace unpkg.com with local build, notebook blank

const el = new StarboardEmbed({
notebookContent: "# %% [javascript]\n3+5\n",
// src: "https://unpkg.com/starboard-notebook@0.12.0/dist/index.html" //ok
src: "https://unpkg.com/starboard-notebook@0.12.1/dist/index.html" //ok
// src: "starboard/index.html" //local build, not working
// src: "http://0.0.0.0:8000/starboard/index.html" //local server,not working either
});

@stefaneidelloth
Copy link

stefaneidelloth commented Nov 2, 2021

I also tried to create a custom html file, including absolute paths instead of relative paths to starboard and use that custom file with starboard-wrap. It does not work. Don't know why.

starboard.html to be used as content for iframe:

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Starboard Notebook</title>
        <meta name="viewport" content="width=device-width,initial-scale=1">
        <link rel="icon" href="favicon.ico">
        <script defer="defer" src="http://localhost:8888/tree/treezjs/node_modules/starboard-notebook/dist/starboard-notebook.js"></script>
        <link href="http://localhost:8888/tree/treezjs/node_modules/starboard-notebook/dist/starboard-notebook.css" rel="stylesheet">
    </head>
    <body>
    </body>
</html>

Usage:

let starboardUrl = "http://localhost:8888/tree/treezjs/src/components/text/code/starboard.html";
        let element = new StarboardEmbed({
            notebookContent: "# %% [javascript]\n3+5\n",
            src: starboardUrl
        });
        codeAreaContainer.appendChild(element);

@gzuidhof
Copy link
Owner

gzuidhof commented Nov 2, 2021

Hmm weird, anything in the console? Does it work when you open the target URL directly?

@stefaneidelloth
Copy link

stefaneidelloth commented Nov 2, 2021

It does works if I use the cdn src instead:
let starboardUrl = "https://cdn.starboard.gg/npm/starboard-notebook@0.13.2/dist/index.html";
There are no error messages on the console and I don't know how I could show possible errors from the iframe.

Opening the starboard.html directly in the browser while the files are served does not work in Chrome.

Edit
It does work in Firefox.

Underlying issues might be that

@stefaneidelloth
Copy link

@futurepaycc Does it work for you in Firefox, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants