New (page-per-artifact) standard library doc examples are now editable and runnable

Yuxuan Shui via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Feb 17 12:38:08 PST 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...


More information about the Digitalmars-d-announce mailing list