"Try it now"

KennyTM~ kennytm at gmail.com
Sun Apr 17 12:37:49 PDT 2011


On Apr 18, 11 02:22, Adam D. Ruppe wrote:
> new version of javascript up:
> http://arsdnet.net/d-web-site/std_algorithm2.html

There are some minor styling bugs. I've only tested it on Chrome 10.

For Example: code blocks:
1. Press "Try Now", then "Cancel" - the code block becomes bold.
2. Click "Try Now" again - the "Cancel" is now in the other line

For non-Example: code blocks:
1. The "Try Now" button appear below the code.
2. Click "Try Now" and "Cancel" moves the button above the code.

----

Also, I suggest the try-now examples should allow using a different 
piece of code than the one shown.

For instance, the introductory code (the sort one) of the std.algorithm 
module clearly shows what the module does, but it absolutely useless for 
Try-Now. The result is "Program ran successfully.", so what? The user 
should be able to see how the array is sorted, how to provide a custom 
predicate, etc., and thus writeln's need to be placed after the 3 sorts. 
This can't be automated by Javascript.

I like the w3schools approach (except the new window part), where the 
main page shows a concise example to let people understand how the 
feature is used, and the "Try it yourself" link provides a complete 
program with human-readable output.


More information about the Digitalmars-d mailing list