February 18, 2017
Am 17.02.2017 um 22:07 schrieb Dmitry Olshansky:
> 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

The example got cut off two or three characters too early, compared with the source unit test. I'll have to check if this is an issue with DDOX, or with the JSON output.
February 18, 2017
Am 18.02.2017 um 14:43 schrieb Sönke Ludwig:
> Am 17.02.2017 um 22:07 schrieb Dmitry Olshansky:
>> 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
>
> The example got cut off two or three characters too early, compared with
> the source unit test. I'll have to check if this is an issue with DDOX,
> or with the JSON output.

Hm, okay, false alert. The characters are there in the page sources and get cut off by the JS that transforms the HTML.
February 18, 2017
On Saturday, 18 February 2017 at 13:46:10 UTC, Sönke Ludwig wrote:
> Am 18.02.2017 um 14:43 schrieb Sönke Ludwig:
>> Am 17.02.2017 um 22:07 schrieb Dmitry Olshansky:
>>> 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
>>
>> The example got cut off two or three characters too early, compared with
>> the source unit test. I'll have to check if this is an issue with DDOX,
>> or with the JSON output.
>
> Hm, okay, false alert. The characters are there in the page sources and get cut off by the JS that transforms the HTML.

Yeah the regex trick doesn't seem to work that well:

-> https://github.com/dlang/dlang.org/pull/1575 (disables the `assert` transformation for now and also changes the output to pre)
February 18, 2017
On Friday, 17 February 2017 at 08:00:29 UTC, Jack Stouffer wrote:
> 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!

Excellent idea!
AFAIK reddit doesn't like self posts that much.
Would someone be so kind to post this once the improvements are in?

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

(this PR disables the `assert` transformation for now and also changes the output to pre.
It will automatically be deployed once merged)
February 18, 2017
On Friday, 17 February 2017 at 16:07:37 UTC, Nick Sabalausky (Abscissa) wrote:
> 1. This is pretty awesome.

Thanks a lot :)

> 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.

I am not sure I follow. Do you use a custom color scheme or plugin that sets the body background color to black?
What exactly would be the best way for you to resolve your problem?
Maybe you can even submit a PR yourself? - the CSS is here:

https://github.com/dlang/dlang.org/blob/master/css/style.css#L1611
February 18, 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.

Excellent idea! As the same js is used for the runnable boxes on the dlang.org main page, I didn't want to touch the editor that much (initially). Anyway I submitted a PR that changes the output element to <pre>:

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

As imho the border doesn't look that bad and for the same reason as above I didn't remove the border. See a visual comparison here:

http://imgur.com/a/pElAu

Are you or others still in favor of removing the border?
February 18, 2017
On 02/18/2017 11:48 AM, Seb wrote:
> On Friday, 17 February 2017 at 16:07:37 UTC, Nick Sabalausky (Abscissa)
> wrote:
>> 1. This is pretty awesome.
>
> Thanks a lot :)
>
>> 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.
>
> I am not sure I follow. Do you use a custom color scheme or plugin that
> sets the body background color to black?

Dark system color scheme, nothing mucking with website CSSes or anything. Somewhat bizarrely/irritatingly, there are certain cases (<input> and <textarea> to my knowledge, maybe others) where browsers inherit default color settings from the OS[1] instead of from a built-in browser-default CSS.

Since my OS is set up to default to (near-)white text on a (near-)black background, the browser decides "Oh, ok, I'll use white text on a black background for inputs and textareas." But then the site's CSS tells it to use a white background. And says nothing about text color. Browser says: "Ok! So, white text (system textbox default) on a white background (website CSS)!!"

[1] Browsers taking theme defaults from the OS was appropriate behavior back in HTML1 when the whole web was actually designed from the ground-up to automatically adapt to the machine being used. But not so much now that every site/page in the world uses its own theme and formatting system[2], and even the browser's own default css *mostly* (with, of course, these broken exceptions) separates itself from the OS, leaving occasionally broken readability.

[2] The site-chosen formatting system occasionally being one that attempts to partially adapt to the local machine, to varying degrees of success. Thanks, legacy of HTML2/4!

Did I mention I hate web browsers? ;)

> What exactly would be the best way for you to resolve your problem?
> Maybe you can even submit a PR yourself? - the CSS is here:
>
> https://github.com/dlang/dlang.org/blob/master/css/style.css#L1611

I'm working out building the site locally right now so I can test (building it seems to be taking awhile), but:

Looks like the site is mostly using #333 for text color. You could just toss in "color: #333;" right next to "background: white;" for the d_code_output sections (might not matter for the div version, but wouldn't hurt either.) That should work.

Or it might be better to just toss this in around the top of the CSS:

--------------------------
input, textarea {
    background-color: white;
    color: #333;
}
--------------------------

February 18, 2017
On 02/18/2017 08:42 PM, Nick Sabalausky (Abscissa) wrote:
>
> Or it might be better to just toss this in around the top of the CSS:
>
> --------------------------
> input, textarea {
>      background-color: white;
>      color: #333;
> }
> --------------------------
>

K, just tested it, works for me:

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

February 19, 2017
On Saturday, 18 February 2017 at 16:43:43 UTC, Seb wrote:

>
> Excellent idea!
> AFAIK reddit doesn't like self posts that much.
> Would someone be so kind to post this once the improvements are in?
>
> https://github.com/dlang/dlang.org/pull/1575
>
> (this PR disables the `assert` transformation for now and also changes the output to pre.
> It will automatically be deployed once merged)

I'll do it. But before I do, I'll want to know that everything is working as intended. Post here with a green light and I'll post it during one of the peak periods.
February 21, 2017
On Sunday, 19 February 2017 at 02:27:41 UTC, Mike Parker wrote:
> On Saturday, 18 February 2017 at 16:43:43 UTC, Seb wrote:
>
>>
>> Excellent idea!
>> AFAIK reddit doesn't like self posts that much.
>> Would someone be so kind to post this once the improvements are in?
>>
>> https://github.com/dlang/dlang.org/pull/1575
>>
>> (this PR disables the `assert` transformation for now and also changes the output to pre.
>> It will automatically be deployed once merged)
>
> I'll do it. But before I do, I'll want to know that everything is working as intended. Post here with a green light and I'll post it during one of the peak periods.

Thanks a lot!
FYI the PR fix has been merged.


Unfortunately it reverts the writeln magic as the false positive rate was too high - at some point we really should come up with something better :/
However the fact that ddoc and ddox emit different, fully built synax-highlighted HTML doesn't make it easier. Maybe the compiler can help out here (?) or we can run a libdparse-based formatter before running ddoc/ddox?
(at least for ddox there is also the intermediate json output of DMD, but for now it seems that the switch to ddox doesn't happen as soon as anticipated)