Thread overview | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 19, 2016 Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Take a look e.g. at https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming. Related: https://github.com/dlang/dlang.org/pull/1297, https://issues.dlang.org/show_bug.cgi?id=16984, https://issues.dlang.org/show_bug.cgi?id=16985. Many thanks to Sebastian Wilzbach who took this to completion, and to Damian Ziemba for working on the online compiler code! Andrei |
December 19, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote:
> Take a look e.g. at https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.
>
> Related: https://github.com/dlang/dlang.org/pull/1297, https://issues.dlang.org/show_bug.cgi?id=16984, https://issues.dlang.org/show_bug.cgi?id=16985.
>
> Many thanks to Sebastian Wilzbach who took this to completion, and to Damian Ziemba for working on the online compiler code!
>
>
> Andrei
I would like to add that this is in an experimental/testing stage and hopefully will get stable with the next release ;-)
|
December 19, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote:
> Take a look e.g. at https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.
>
> Related: https://github.com/dlang/dlang.org/pull/1297, https://issues.dlang.org/show_bug.cgi?id=16984, https://issues.dlang.org/show_bug.cgi?id=16985.
>
> Many thanks to Sebastian Wilzbach who took this to completion, and to Damian Ziemba for working on the online compiler code!
>
>
> Andrei
It looks great, but I think that the source code should not be hidden when pressing the Run button, instead the application output box should appear above/below the source code :-)
|
December 19, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | Excellent work, thank you! |
December 19, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jakub Szewczyk | On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk wrote:
> It looks great, but I think that the source code should not be hidden when pressing the Run button, instead the application output box should appear above/below the source code :-)
+1
Otherwise that is great!
|
December 20, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Picaud Vincent | On Monday, 19 December 2016 at 19:11:26 UTC, Picaud Vincent wrote:
> On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk wrote:
>
>> It looks great, but I think that the source code should not be hidden when pressing the Run button, instead the application output box should appear above/below the source code :-)
>
> +1
>
> Otherwise that is great!
+1 also.
|
December 20, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Seb | On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote:
> On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote:
>> Take a look e.g. at https://dlang.org/phobos-prerelease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming.
>>
>> Related: https://github.com/dlang/dlang.org/pull/1297, https://issues.dlang.org/show_bug.cgi?id=16984, https://issues.dlang.org/show_bug.cgi?id=16985.
>>
>> Many thanks to Sebastian Wilzbach who took this to completion, and to Damian Ziemba for working on the online compiler code!
>>
>>
>> Andrei
>
> I would like to add that this is in an experimental/testing stage and hopefully will get stable with the next release ;-)
When all tests pass, would be better if it said that, rather than "No output," which it says now.
|
December 19, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Joakim Attachments:
| is it properly sandboxed / hacking proof? quick tests: ``` import std.process; auto msg="sleep 10"; executeShell(msg).output.writeln; ``` correctly results in `Application output (9: Killed)` "ls -al .." => permission denied "ls /usr/bin/ld" => -rwxr-xr-x 2 0 0 834648 Jan 3 2013 /usr/bin/ld "ps -auwx" => ... On Mon, Dec 19, 2016 at 6:25 PM, Joakim via Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> wrote: > On Monday, 19 December 2016 at 17:50:17 UTC, Seb wrote: > >> On Monday, 19 December 2016 at 17:44:29 UTC, Andrei Alexandrescu wrote: >> >>> Take a look e.g. at https://dlang.org/phobos-prere lease/std_algorithm_iteration.html. Examples now have "Edit" and "Run" buttons that allow you to play with them online and see what they output. Changes for the ddox version forthcoming. >>> >>> Related: https://github.com/dlang/dlang.org/pull/1297, https://issues.dlang.org/show_bug.cgi?id=16984, https://issues.dlang.org/show_bug.cgi?id=16985. >>> >>> Many thanks to Sebastian Wilzbach who took this to completion, and to Damian Ziemba for working on the online compiler code! >>> >>> >>> Andrei >>> >> >> I would like to add that this is in an experimental/testing stage and hopefully will get stable with the next release ;-) >> > > When all tests pass, would be better if it said that, rather than "No output," which it says now. > |
December 20, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Soulsbane | On Tuesday, 20 December 2016 at 01:34:30 UTC, Soulsbane wrote: > On Monday, 19 December 2016 at 19:11:26 UTC, Picaud Vincent wrote: >> On Monday, 19 December 2016 at 18:54:56 UTC, Jakub Szewczyk wrote: >> >>> It looks great, but I think that the source code should not be hidden when pressing the Run button, instead the application output box should appear above/below the source code :-) >> >> +1 >> >> Otherwise that is great! > > +1 also. Thanks a lot for your feedback! This will hopefully soon be online: https://github.com/dlang/dlang.org/pull/1527 |
December 20, 2016 Re: Many documentation examples can now be run online | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Tuesday, 20 December 2016 at 06:16:23 UTC, Timothee Cour wrote: > is it properly sandboxed / hacking proof? > > quick tests: > > ``` > import std.process; > auto msg="sleep 10"; > executeShell(msg).output.writeln; > ``` > > correctly results in `Application output (9: Killed)` > > "ls -al .." => permission denied > > "ls /usr/bin/ld" => -rwxr-xr-x 2 0 0 834648 Jan 3 2013 /usr/bin/ld > > "ps -auwx" => ... > It uses DPaste (https://dpaste.dzfl.pl/) as backend - in fact I tried to re-use most of the code for the example snippet on dlang.org |
Copyright © 1999-2021 by the D Language Foundation