Jump to page: 1 2 3
Thread overview
New (page-per-artifact) standard library doc examples are now editable and runnable
Jan 07, 2017
Martin Nowak
Jan 07, 2017
Seb
Feb 17, 2017
Yuxuan Shui
Feb 17, 2017
Seb
Feb 17, 2017
Jack Stouffer
Feb 18, 2017
Seb
Feb 19, 2017
Mike Parker
Feb 21, 2017
Seb
Feb 22, 2017
Seb
Feb 27, 2017
Mike Parker
Feb 27, 2017
Seb
Feb 27, 2017
David Nadlinger
Feb 27, 2017
Seb
Feb 27, 2017
David Nadlinger
Feb 27, 2017
Adam D. Ruppe
Feb 28, 2017
Mike Parker
Feb 17, 2017
John Colvin
Feb 17, 2017
bachmeier
Feb 18, 2017
Seb
Feb 23, 2017
bachmeier
Feb 17, 2017
Dmitry Olshansky
Feb 18, 2017
Sönke Ludwig
Feb 18, 2017
Sönke Ludwig
Feb 18, 2017
Seb
Feb 18, 2017
Seb
January 07, 2017
Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.

Thanks are due to Sönke Ludwig and Sebastian Wilzbach!


Andrei
January 07, 2017
On 01/07/2017 05:12 PM, Andrei Alexandrescu wrote:
> Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.
> 
> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!

Thanks, this is quite an amazing step towards more interactive
documentation.
Should we start to produce output as well, e.g. with some magic
`writeln` that's silent in actual tests?
January 07, 2017
On Saturday, 7 January 2017 at 20:14:56 UTC, Martin Nowak wrote:
> On 01/07/2017 05:12 PM, Andrei Alexandrescu wrote:
>> Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.
>> 
>> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!
>
> Thanks, this is quite an amazing step towards more interactive
> documentation.
> Should we start to produce output as well, e.g. with some magic
> `writeln` that's silent in actual tests?

There's already some simple support for this in the ddoc pages, e.g. the pattern `assert(a == b);` is automatically rewritten to `writeln(a); // b`

https://dlang.org/phobos-prerelease/std_algorithm_searching.html#.minElement

However as ddox produces a different output, it doesn't work at the moment with the ddox build.
I made a PR:

https://github.com/dlang/dlang.org/pull/1551

Of course help to make this smarter is welcome ;-)
February 17, 2017
On Saturday, 7 January 2017 at 16:12:49 UTC, Andrei Alexandrescu wrote:
> Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.
>
> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!
>
>
> Andrei

Short follow-up: this is now live for the released documentation pages. Enjoy!

Ddoc: https://dlang.org/phobos/std_algorithm_comparison.html#among
Ddox: https://dlang.org/library/std/algorithm/comparison/among.html

Your feedback is of course welcome.

A couple of modules are still blacklisted, but it's WIP to remove the blacklist [1].
Also as mentioned DPaste [2] is used as Backend.

If you want to hack with it directly, you may have a look at [3].

Cheers,

Seb

[1] https://github.com/dlang/phobos/pull/5142
[2] https://dlang.org/blog/2017/01/30/project-highlight-dpaste/
[3] https://github.com/dlang/dlang.org/blob/master/js/run_examples.js
February 17, 2017
On Friday, 17 February 2017 at 05:06:20 UTC, Seb wrote:
> Short follow-up: this is now live for the released documentation pages. Enjoy!

Please make a post on Reddit!

I firmly believe that this puts D at the top of programming language docs. We should advertise!
February 17, 2017
On Friday, 17 February 2017 at 05:06:20 UTC, Seb wrote:
> On Saturday, 7 January 2017 at 16:12:49 UTC, Andrei Alexandrescu wrote:
>> Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.
>>
>> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!
>>
>>
>> Andrei
>
> Short follow-up: this is now live for the released documentation pages. Enjoy!
>
> Ddoc: https://dlang.org/phobos/std_algorithm_comparison.html#among
> Ddox: https://dlang.org/library/std/algorithm/comparison/among.html
>
> Your feedback is of course welcome.
>
> A couple of modules are still blacklisted, but it's WIP to remove the blacklist [1].
> Also as mentioned DPaste [2] is used as Backend.
>
> If you want to hack with it directly, you may have a look at [3].
>
> Cheers,
>
> Seb
>
> [1] https://github.com/dlang/phobos/pull/5142
> [2] https://dlang.org/blog/2017/01/30/project-highlight-dpaste/
> [3] https://github.com/dlang/dlang.org/blob/master/js/run_examples.js

Might I suggest you change the output <textarea>s to <pre>s with border: none; and max-height: 30em;
This would make them auto-grow to the right height to fit the content (with max-height for sanity). It does mean you lose manual resizability (unless you mess around in js to sort out the clash with max-height)), but that doesn't seem so important if it auto-resizes.
February 17, 2017
On Friday, 17 February 2017 at 13:50:48 UTC, John Colvin wrote:

> Might I suggest you change the output <textarea>s to <pre>s with border: none; and max-height: 30em;
> This would make them auto-grow to the right height to fit the content (with max-height for sanity). It does mean you lose manual resizability (unless you mess around in js to sort out the clash with max-height)), but that doesn't seem so important if it auto-resizes.

+1
February 17, 2017
On 01/07/2017 11:12 AM, Andrei Alexandrescu wrote:
> Following https://github.com/dlang/dlang.org/pull/1532, the new-style
> docs now also allow editing and running examples. Start at
> http://dlang.org/library-prerelease/ and go anywhere to check it out.
>
> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!
>
>
> Andrei

1. This is pretty awesome.

2. Looks like someone forgot to set a foreground text color for the output even though the background is set to white. This makes the output text invisible for those using eye-friendly light-on-dark systems.
February 17, 2017
On Saturday, 7 January 2017 at 21:19:42 UTC, Seb wrote:
> On Saturday, 7 January 2017 at 20:14:56 UTC, Martin Nowak wrote:
>> On 01/07/2017 05:12 PM, Andrei Alexandrescu wrote:
>>> Following https://github.com/dlang/dlang.org/pull/1532, the new-style docs now also allow editing and running examples. Start at http://dlang.org/library-prerelease/ and go anywhere to check it out.
>>> 
>>> Thanks are due to Sönke Ludwig and Sebastian Wilzbach!
>>
>> Thanks, this is quite an amazing step towards more interactive
>> documentation.
>> Should we start to produce output as well, e.g. with some magic
>> `writeln` that's silent in actual tests?
>
> There's already some simple support for this in the ddoc pages, e.g. the pattern `assert(a == b);` is automatically rewritten to `writeln(a); // b`

Looks like the result is not always valid, see: https://dlang.org/library/std/algorithm/searching/find.html

Probably shouldn't use regex to parse context free grammar...
February 17, 2017
On 2/17/17 6:06 AM, Seb wrote:
> On Saturday, 7 January 2017 at 16:12:49 UTC, Andrei Alexandrescu wrote:
>> Following https://github.com/dlang/dlang.org/pull/1532, the new-style
>> docs now also allow editing and running examples. Start at
>> http://dlang.org/library-prerelease/ and go anywhere to check it out.
>>

Broken on the first example I tried :(

http://dlang.org/library-prerelease/std/algorithm/searching/find.html

---
Dmitry Olshansky
« First   ‹ Prev
1 2 3