Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve runnable: disable assert to writeln transformation + make output a pre element #1575

Merged
merged 2 commits into from Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions css/style.css
Expand Up @@ -1610,7 +1610,7 @@ div.changelog-nav

/* Runnable-examples css */
textarea.d_code {display: none;}
textarea.d_code_output, textarea.d_code_stdin, textarea.d_code_args
textarea.d_code_stdin, textarea.d_code_args
{
text-align: left;
border: none;
Expand All @@ -1624,6 +1624,11 @@ textarea.d_code_output, textarea.d_code_stdin, textarea.d_code_args
outline: none;
}

pre.d_code_output {
border: none;
max-height: 30em;
}

div.d_code {margin: 0; padding: 0; background: #F5F5F5;}
div.d_run_code {display: none;}
div.d_code_output, div.d_code_stdin, div.d_code_args, div.d_code_unittest
Expand Down Expand Up @@ -1681,6 +1686,11 @@ input.editButton:active
position: relative; top: 1px;
}
input.resetButton{display: none}

/* Style for the example run buttons on the Phobos library documentation */
.d_example_buttons {
text-align: left;
}
/* Runnable-examples css -end */

.page-contents
Expand Down Expand Up @@ -2113,8 +2123,3 @@ dt.d_decl:hover .decl_anchor {
text-decoration: none;
color: #333;
}

/* Style for the example run buttons on the Phobos library documentation */
.d_example_buttons {
text-align: left;
}
4 changes: 2 additions & 2 deletions js/run.js
Expand Up @@ -370,7 +370,7 @@ $(document).ready(function()
+ '<textarea class="d_code_stdin">'+stdin+'</textarea></div>'
+ '<div class="d_code_args"><span class="d_code_title">Command line arguments</span><br>'
+ '<textarea class="d_code_args">'+args+'</textarea></div>'
+ '<div class="d_code_output"><span class="d_code_title">Application output</span><br><textarea class="d_code_output" readonly>Running...</textarea></div>'
+ '<div class="d_code_output"><span class="d_code_title">Application output</span><br><pre class="d_code_output" readonly>Running...</pre></div>'
+ '<input type="button" class="editButton" value="Edit">'
+ '<input type="button" class="argsButton" value="Args">'
+ '<input type="button" class="inputButton" value="Input">'
Expand Down Expand Up @@ -456,7 +456,7 @@ function setupTextarea(el, opts)

var plainSourceCode = parent.parent().children("div.d_code");

var output = outputDiv.children("textarea.d_code_output");
var output = outputDiv.children("pre.d_code_output");
var outputTitle = outputDiv.children("span.d_code_title");
if (opts.args) {
var argsBtn = parent.children("input.argsButton");
Expand Down
5 changes: 3 additions & 2 deletions js/run_examples.js
Expand Up @@ -59,7 +59,8 @@ $(document).ready(function()
var currentExample = $(this);
var orig = currentExample.html();

orig = reformatExample(orig);
// disable regex assert -> writeln rewrite logic (for now)
//orig = reformatExample(orig);

// check whether it is from a ddoced unittest
// 1) check is for ddoc, 2) for ddox
Expand All @@ -81,7 +82,7 @@ $(document).ready(function()
+ '<div class="d_run_code" style="display: block">'
+ '<textarea class="d_code" style="display: none;"></textarea>'
+ '</div>'
+ '<div class="d_code_output"><span class="d_code_title">Application output</span><br><textarea class="d_code_output" readonly>Running...</textarea>'
+ '<div class="d_code_output"><span class="d_code_title">Application output</span><br><pre class="d_code_output" readonly>Running...</pre>'
+ '</div>'
);
});
Expand Down