Bug 17560 – Enhancement: view and copy full code example for offline compile/play

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-26T22:56:33Z
Last change time
2017-08-16T13:23:29Z
Keywords
pull
Assigned to
No Owner
Creator
Alexey Kulentsov

Comments

Comment #0 by crimaniak — 2017-06-26T22:56:33Z
Now we have code examples which can be edited and run online. But there are two circumstances that make it difficult to use examples for beginners. First, the examples on the site do not always work, and secondly, they are incomplete in terms of imports. Therefore, a neophyte can not just save an example to a disc and start playing with it. I propose an additional button that shows the complete, compilable example text.
Comment #1 by greensunny12 — 2017-06-27T04:48:32Z
> First, the examples on the site do not always work They _always_ work. We test this in our CI (e.g. https://github.com/dlang/phobos/blob/master/posix.mak#L596). > I propose an additional button that shows the complete, compilable example text. This is already in the queue: https://github.com/dlang/dlang.org/pull/1669 Feel free to vote for the PR ;-)
Comment #2 by crimaniak — 2017-06-27T11:59:42Z
(In reply to greensunny12 from comment #1) > > First, the examples on the site do not always work > > They _always_ work. We test this in our CI (e.g. > https://github.com/dlang/phobos/blob/master/posix.mak#L596). Sorry, but no, not always. I mean problems on live site like described here: https://forum.dlang.org/post/[email protected] > > I propose an additional button that shows the complete, compilable example text. > > This is already in the queue: https://github.com/dlang/dlang.org/pull/1669 > Feel free to vote for the PR ;-) I did the search before posting issue, but miss this one. Thanks!
Comment #3 by crimaniak — 2017-06-27T12:02:24Z
Duplicate so will close.
Comment #4 by greensunny12 — 2017-06-27T21:53:59Z
> Duplicate so will close. Of what issue? (reopening) > Sorry, but no, not always. I mean problems on live site like described here: https://forum.dlang.org/post/[email protected] I did reply on the thread. tl:dr: not much we can do because the execution is an external service (DPaste) Though there's a PR in the queue to switch over to the tour (more powerful, uses docker with ~1GB max. per container): https://github.com/dlang/dlang.org/pull/1647 [1] https://forum.dlang.org/post/[email protected] > I did the search before posting issue, but miss this one. Thanks! You are very welcome. Please raise your voice on this PR if you want it to be merged ;-)
Comment #5 by github-bugzilla — 2017-06-28T13:48:43Z
Commit pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/72f109646392dd412e77dc6db1a2cbe34285c9a2 Add 'Open in editor' button for runnable code examples Fix Issue 17560 - Enhancement: view and copy full code example for offline compile/play
Comment #6 by github-bugzilla — 2017-08-14T23:56:05Z
Commit pushed to newCTFE at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/72f109646392dd412e77dc6db1a2cbe34285c9a2 Add 'Open in editor' button for runnable code examples
Comment #7 by github-bugzilla — 2017-08-16T13:23:29Z
Commit pushed to stable at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/72f109646392dd412e77dc6db1a2cbe34285c9a2 Add 'Open in editor' button for runnable code examples