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

How to add Blocks to a HTML page #623

Closed
stritti opened this issue Feb 5, 2018 · 15 comments
Closed

How to add Blocks to a HTML page #623

stritti opened this issue Feb 5, 2018 · 15 comments

Comments

@stritti
Copy link

stritti commented Feb 5, 2018

Is ist possible to add source examples in Block-style to a web page?
I would prefer this instead of creating unchangeable screenshots.

@pelikhan
Copy link
Member

pelikhan commented Feb 5, 2018

@stritti
Copy link
Author

stritti commented Feb 5, 2018

Great, haven't saw it. THX!

@stritti stritti closed this as completed Feb 5, 2018
@stritti
Copy link
Author

stritti commented Feb 6, 2018

I was not able to understand the mentioned docu. I have reverse engineered the rendering in of the documentation itself and created a gist: https://gist.github.com/stritti/e47d780cedc0146e9c3b7e7c0e8eee68

@pelikhan
Copy link
Member

pelikhan commented Feb 6, 2018

Right this one is invasive as it injects css and js in the page. The documented approach uses iframe a to avoid that

@stritti
Copy link
Author

stritti commented Feb 6, 2018

You are right, @pelikhan. But I was not really able to follow the documentation you provided.
Maybe a small vanilla JS example could really help.

@pelikhan
Copy link
Member

pelikhan commented Feb 6, 2018

Let me see if i can fiddle one.

@pelikhan
Copy link
Member

pelikhan commented Feb 6, 2018

See https://jsfiddle.net/ndyz1d57/1/

@stritti
Copy link
Author

stritti commented Feb 6, 2018

Awesome, many thanks @pelikhan! This helped me a lot! Really simple solution.
I thought far too complicated. A simple example is often better than a lot words :)

@pelikhan
Copy link
Member

pelikhan commented Feb 6, 2018

Which web site are you instrumenting ? :)

@stritti
Copy link
Author

stritti commented Feb 6, 2018

I am currently set up a HTML5-presentation for the "GirlsDay" in Germany: https://github.com/stritti/girlsday-einfuehrung-informatik

It is currently very basic, I just wanted to see, that I need not to screenshot the Blocks first :)

stritti added a commit to stritti/girlsday-einfuehrung-informatik that referenced this issue Feb 6, 2018
@stritti
Copy link
Author

stritti commented Feb 6, 2018

Now I updated rendering successfully and could start in the next days adding the useful content. The frame is ready.

@dnowba
Copy link

dnowba commented Feb 23, 2019

Now I updated rendering successfully and could start in the next days adding the useful content. The frame is ready.
But how if I just want to show one block? for example, a "input.lightLevel()" block ???

@stritti
Copy link
Author

stritti commented Feb 23, 2019

But how if I just want to show one block? for example, a "input.lightLevel()" block ???

Have a look at https://github.com/stritti/girlsday-einfuehrung-informatik there are some examples.

@dnowba
Copy link

dnowba commented Feb 24, 2019

I've test it, but it is not working when rendering single Circle Shape Block, or a boolean Block.
Sometimes I just output a single block for inline purpose.

@stritti
Copy link
Author

stritti commented Feb 26, 2019

in my environment it works fin. Have a look on this (German) slide: https://stritti.github.io/girlsday-einfuehrung-informatik/#/Blocks-Variablen
associated sources: https://github.com/stritti/girlsday-einfuehrung-informatik/blob/a65e4e2460b1e09ad24e05c339d464175bf5985f/src/index.html#L483

Maybe you could provide a source example.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants