Skip to content

Commit e292e9f

Browse files
committed
fixed code chunk copy button, new link to dclight.js
1 parent e3a1508 commit e292e9f

13 files changed

+42
-94
lines changed

DCL/intro_1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<head>
33
<meta charset='utf-8'/>
4-
<script async='async' src='https://cdn.datacamp.com/dcl-react-dev.js.gz'></script>
4+
<script async='async' src='https://cdn.datacamp.com/dcl-react.js.gz'></script>
55
<style>
66
.DCexercise .datacamp-exercise {
77
border: 2px solid #3D678D;

DCL/override_files.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
script <- "<script async='async' src='https://cdn.datacamp.com/dcl-react-dev.js.gz'></script>"
1+
script <- "<script async='async' src='https://cdn.datacamp.com/dcl-react.js.gz'></script>"
22

33
inject_document_head <- function(script, css_file = "", workdir = "/URFITE Bookdown/DCL") {
44
# set directory to look for files

docs/1-1-a-very-short-introduction-to-r-and-rstudio.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<meta name="author" content="Christoph Hanck, Martin Arnold, Alexander Gerber and Martin Schmelzer" />
2525

2626

27-
<meta name="date" content="2020-07-21" />
27+
<meta name="date" content="2020-07-22" />
2828

2929
<meta name="viewport" content="width=device-width, initial-scale=1" />
3030
<meta name="apple-mobile-web-app-capable" content="yes" />

docs/1-introduction.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<meta name="author" content="Christoph Hanck, Martin Arnold, Alexander Gerber and Martin Schmelzer" />
2525

2626

27-
<meta name="date" content="2020-07-21" />
27+
<meta name="date" content="2020-07-22" />
2828

2929
<meta name="viewport" content="width=device-width, initial-scale=1" />
3030
<meta name="apple-mobile-web-app-capable" content="yes" />
@@ -402,7 +402,7 @@ <h1><span class="header-section-number">1</span> Introduction</h1>
402402
<p>As an example, consider the following line of code presented in chunk below. It tells <tt>R</tt> to compute the number of packages available on <tt>CRAN</tt>. The code chunk is followed by the output produced.</p>
403403
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="1-introduction.html#cb1-1"></a><span class="co"># check the number of R packages available on CRAN</span></span>
404404
<span id="cb1-2"><a href="1-introduction.html#cb1-2"></a><span class="kw">nrow</span>(<span class="kw">available.packages</span>(<span class="dt">repos =</span> <span class="st">&quot;http://cran.us.r-project.org&quot;</span>))</span></code></pre></div>
405-
<pre><code>## [1] 16037</code></pre>
405+
<pre><code>## [1] 16035</code></pre>
406406
<p>Each code chunk is equipped with a button on the outer right hand side which copies the code to your clipboard. This makes it convenient to work with larger code segments in your version of <tt>R</tt>/<em>RStudio</em> or in the widgets presented throughout the book. In the widget above, you may click on <tt>R Console</tt> and type <code>nrow(available.packages(repos = "http://cran.us.r-project.org"))</code> (the command from the code chunk above) and execute it by hitting <em>Enter</em> on your keyboard.<a href="#fn2" class="footnote-ref" id="fnref2"><sup>2</sup></a></p>
407407
<p>Note that some lines in the widget are out-commented which ask you to assign a numeric value to a variable and then to print the variable’s content to the console. You may enter your solution approach to <tt>script.R</tt> and hit the button <em>Run</em> in order to get the feedback described further above. In case you do not know how to solve this sample exercise (don’t panic, that is probably why you are reading this), a click on <em>Hint</em> will provide you with some advice. If you still can’t find a solution, a click on <em>Solution</em> will provide you with another tab, <tt>Solution.R</tt> which contains sample solution code. It will often be the case that exercises can be solved in many different ways and <tt>Solution.R</tt> presents what we consider as comprehensible and idiomatic.</p>
408408
</div>

docs/DCL/intro_1.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<head>
33
<meta charset='utf-8'/>
4-
<script async='async' src='https://cdn.datacamp.com/dcl-react-dev.js.gz'></script>
4+
<script async='async' src='https://cdn.datacamp.com/dcl-react.js.gz'></script>
55
<style>
66
.DCexercise .datacamp-exercise {
77
border: 2px solid #3D678D;

docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<meta name="author" content="Christoph Hanck, Martin Arnold, Alexander Gerber and Martin Schmelzer" />
2525

2626

27-
<meta name="date" content="2020-07-21" />
27+
<meta name="date" content="2020-07-22" />
2828

2929
<meta name="viewport" content="width=device-width, initial-scale=1" />
3030
<meta name="apple-mobile-web-app-capable" content="yes" />
@@ -390,15 +390,15 @@ <h1>
390390
<div id="header">
391391
<h1 class="title">Introduction to Econometrics with R</h1>
392392
<p class="author"><em>Christoph Hanck, Martin Arnold, Alexander Gerber and Martin Schmelzer</em></p>
393-
<p class="date"><em>2020-07-21</em></p>
393+
<p class="date"><em>2020-07-22</em></p>
394394
</div>
395395
<div id="preface" class="section level1 unnumbered">
396396
<h1>Preface</h1>
397397
<hr style="background-color:#3C6690;height:2px">
398398
<center>
399399
<img src='images/cover.png' style = 'width:60%;'>
400400
</center>
401-
<p><br> Chair of Econometrics <img style='float: right; margin: 0px 100px 0px 0px; width:35%' src='images/logo_claim_en_rgb.png'/> <br> Department of Business Administration and Economics <br> University of Duisburg-Essen <br> Essen, Germany <br> <a href=\"mailto:[email protected]?subject=Econometrics%20with%20R\">[email protected]</a> <br><br> Last updated on Tuesday, July 21, 2020
401+
<p><br> Chair of Econometrics <img style='float: right; margin: 0px 100px 0px 0px; width:35%' src='images/logo_claim_en_rgb.png'/> <br> Department of Business Administration and Economics <br> University of Duisburg-Essen <br> Essen, Germany <br> <a href=\"mailto:[email protected]?subject=Econometrics%20with%20R\">[email protected]</a> <br><br> Last updated on Wednesday, July 22, 2020
402402
<br>
403403
<br>
404404
<iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FEconometricsWithR%2F&width=450&layout=standard&action=like&size=small&show_faces=true&share=true&height=80&appId" width="400" height="70" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allow="encrypted-media" align="left"></iframe>

docs/js/hideOutput.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ $(document).ready(function() {
3030
// });
3131

3232
// Copy Button
33-
$chunks = $('pre.sourceCode > code.sourceCode');
33+
// $chunks = $('pre.sourceCode > code.sourceCode');
3434

35-
$chunks.each(function(i, val) {
36-
$(this).prepend("<button class=\"download\"><i class=\"fa fa-download fa-2x\"></i></button>").click(function() {
37-
var $temp = $('<a />');
38-
$("body").append($temp);
39-
var content = $(this).clone().children("button").remove().end().text();
40-
$temp.attr({
41-
download: $(this).closest('div').attr('id') +'.R',
42-
href: "data:text/plain;charset=utf-8," + encodeURIComponent(content)
43-
})[0].click();
44-
$temp.remove();
45-
});
46-
});
35+
// $chunks.each(function(i, val) {
36+
// $(this).prepend("<button class=\"download\"><i class=\"fa fa-download fa-2x\"></i></button>").click(function() {
37+
// var $temp = $('<a />');
38+
// $("body").append($temp);
39+
// var content = $(this).clone().children("button").remove().end().text();
40+
// $temp.attr({
41+
// download: $(this).closest('div').attr('id') +'.R',
42+
// href: "data:text/plain;charset=utf-8," + encodeURIComponent(content)
43+
// })[0].click();
44+
// $temp.remove();
45+
// });
46+
// });
4747

4848
// $chunks.each(function(i, val) {
4949
//

0 commit comments

Comments
 (0)