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

John Colvin via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Feb 17 05:50:48 PST 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.


More information about the Digitalmars-d-announce mailing list