[ 
https://issues.apache.org/jira/browse/GROOVY-9975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17298645#comment-17298645
 ] 

Björn Kautler commented on GROOVY-9975:
---------------------------------------

Yes, I know it and often use it, it is like 
[https://play.kotlinlang.org|https://play.kotlinlang.org/], just not as pretty 
and with the option to select the version.

But it is only one third of the whole thing.

Did you have a look at the link I posted or the examples in the Kotlin docs? 
For example first two examples on 
[https://kotlinlang.org/docs/null-safety.html].

The second third would be that the Groovy web console sets CORS headers, so 
that the {{executor.groovy}} script can be called from XmlHttpRequests of other 
domains, to have a remote execution capability.

The third third would be a JS component like the one I linked to, that could 
easily be used on any page including Groovy documentation to have inline 
executable and editable examples easily. Actually the mentioned component can 
probably be used with slight modifications. It is ASLv2 licensed, it can also 
handle Groovy in the read-only mode and the execution is already encapsulated. 
It mainly needs a changed {{if}} statement to not only make Kotlin snippets 
executable and a different remote client that talks to the Groovy web console 
(or any compatible url like meetspock) instead of the Kotlin playground.

> Embeddable playground component
> -------------------------------
>
>                 Key: GROOVY-9975
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9975
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Björn Kautler
>            Priority: Major
>
> The Kotlin documentation have a nice feature, that most examples shown there 
> are editable and executable right from inside the documentation. This is 
> really an amazing feature for a language documentation as you can see the 
> documented feature in action right away and can even directly play with it.
> There is even this: [https://www.npmjs.com/package/kotlin-playground]
> This is a script that anyone can use on his personal page or blog or whatever 
> to also have those nifty embedded executable Kotlin editors in their pages or 
> blogs.
> It would be really cool if there would be a similar component for Groovy too 
> that you can use and that maybe also the Groovy documentation would use for 
> its examples.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to