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

URLs with specific demo code #8

Open
devbali opened this issue Nov 7, 2019 · 1 comment
Open

URLs with specific demo code #8

devbali opened this issue Nov 7, 2019 · 1 comment
Assignees

Comments

@devbali
Copy link
Contributor

devbali commented Nov 7, 2019

This was something we talked about in the Retreat. @JustinAzoff had a plan to have a "try" button on any piece of demo code on the documentation. The most straightforward way to go through with this (that I can think of) would be to get code from a URL parameter. Thoughts?

@devbali devbali self-assigned this Nov 7, 2019
@JustinAzoff
Copy link
Contributor

There's a few ways to handle this.

As you said there can be a link to try zeek that includes the code snippet in the url. Once followed this will set the current file to the passed snippet and run it. This would be very easy to implement in handleLocationChange, but the max length would be about 2048 chars.

Another way to have something like this work is to just use the api in the documentation. I wrote an example for this a while back using jquery:

https://github.com/zeek/try-zeek/blob/master/client/trybro_embed.js + https://github.com/zeek/try-zeek/blob/master/client/embed.html

You can test that here: http://www.ncsa.illinois.edu/People/jazoff/bro.html (ignore the bro_init warnings :-))

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

No branches or pull requests

2 participants