Skip to content

Commit afb7d99

Browse files
committed
distillerizing
1 parent 163beb2 commit afb7d99

File tree

10 files changed

+125
-175
lines changed

10 files changed

+125
-175
lines changed

_footer.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[R We Having Fun Yet‽](https://rfun.library.duke.edu/)
2+
3+
[Center for Data & Visualization Sciences](https://library.duke.edu/data/).
4+
[Duke University Libraries](https://library.duke.edu/)

_site.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
name: "Git & RStudio"
22
title: "RStudio & Version Control"
3+
favicon: libs-local/rfun_logo.png
4+
base_url: https://rfun.library.duke.edu
5+
repository_url: https://github.com/data-and-visualization/git-tutorial
6+
twitter:
7+
site: "@duke_data"
38
description: |
49
How to use RStudio with Git & GitHub
5-
# exclude:
6-
# - README.md
7-
# - license.md
810
# favicon: logo.png
11+
creative_commons: CC BY-NC
912
navbar:
10-
# title: "RStudio & Version Control"
1113
logo:
1214
image: libs-local/rfun_logo.png
1315
href: https://rfun.library.duke.edu
14-
left:
16+
right:
1517
- text: "Resources"
1618
href: "resources.html"
17-
# logo:
18-
# image: libs-local/rfun_logo.png
19-
# href: https://rfun.library.duke.edu
20-
right:
2119
- icon: fa-github
2220
# - text: "GitHub"
23-
href: https://github.com/data-and-visualization/git-tutorial/
21+
href: https://github.com/data-and-visualization/git-tutorial/
2422
# - icon: fa-home
2523
# # - text: "Home"
2624
# menu:
@@ -31,8 +29,8 @@ navbar:
3129
output_dir: docs
3230
output:
3331
distill::distill_article:
34-
include:
35-
after_body: libs-local/footer.html
36-
css:
32+
# include:
33+
# after_body: libs-local/footer.html
34+
# css:
3735
# - libs-local/duke.css
38-
- libs-local/cc-fonts.css
36+
# libs-local/cc-fonts.css

docs/index.html

Lines changed: 63 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989

9090
<meta property="description" itemprop="description" content="Makin&#39; it work!!"/>
9191

92+
<link rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/"/>
93+
<link rel="icon" type="image/png" href="libs-local/rfun_logo.png"/>
9294

9395

9496
<!-- https://developers.facebook.com/docs/sharing/webmasters#markup -->
@@ -102,6 +104,7 @@
102104
<meta property="twitter:card" content="summary"/>
103105
<meta property="twitter:title" content="RStudio &amp; Version Control: Git, GitHub &amp; RStudio"/>
104106
<meta property="twitter:description" content="Makin&#39; it work!!"/>
107+
<meta property="twitter:site" content="@duke_data"/>
105108

106109
<!--/radix_placeholder_meta_tags-->
107110
<!--radix_placeholder_rmarkdown_metadata-->
@@ -1995,42 +1998,8 @@ <h3>${suggestion.title}</h3>
19951998
<script src="site_libs/webcomponents-2.0.0/webcomponents.js"></script>
19961999
<script src="site_libs/distill-2.2.21/template.v2.js"></script>
19972000
<!--radix_placeholder_site_in_header-->
1998-
<style type="text/css">
1999-
@font-face {
2000-
font-family: 'CC-ICONS';
2001-
font-style: normal;
2002-
/* font-weight: normal; */
2003-
src: url('cc-icons.ttf') format('truetype');
2004-
}
2005-
2006-
2007-
.cc {
2008-
font-family: 'CC-ICONS';
2009-
color: #0736A4;
2010-
font-size: 200%;
2011-
}
2012-
2013-
.footer {
2014-
display: table;
2015-
/* border: 1px solid #666; */
2016-
padding: 20px; /* Apply cell padding */
2017-
width: 95%;
2018-
opacity: 0.65;
2019-
}
2020-
2021-
.left-foot {
2022-
display: table-cell;
2023-
text-align: left;
2024-
}
2025-
2026-
.right-foot {
2027-
display: table-cell;
2028-
text-align: right;
2029-
}
2030-
</style>
20312001
<!--/radix_placeholder_site_in_header-->
20322002

2033-
<link rel="stylesheet" href="libs-local\cc-fonts.css" type="text/css"/>
20342003

20352004
</head>
20362005

@@ -2051,9 +2020,9 @@ <h3>${suggestion.title}</h3>
20512020
<img src="libs-local/rfun_logo.png" alt="Logo"/>
20522021
</a>
20532022
<a href="index.html" class="title">RStudio &amp; Version Control</a>
2054-
<a href="resources.html">Resources</a>
20552023
</div>
20562024
<div class="nav-right">
2025+
<a href="resources.html">Resources</a>
20572026
<a href="https://github.com/data-and-visualization/git-tutorial/">
20582027
<i class="fa fa-github" aria-hidden="true"></i>
20592028
</a>
@@ -2074,41 +2043,62 @@ <h1>Git, GitHub &amp; RStudio</h1>
20742043

20752044

20762045
<div class="d-article">
2077-
<p>Using RStudio to manage version control got a lot easier with the version 2.x release of the <a href="https://usethis.r-lib.org/"><code>usethis</code></a> package. Therefore, this site now consists of links and tips.</p>
2078-
<p>After <code>usethis</code> setup, take your reproducibility to the next level. <a href="https://guides.github.com/activities/citable-code/">Make your code citable</a> by connecting your GitHub repo and your <a href="https://orcid.org/register">ORCID</a> (unique author ID) to the <a href="https://zenodo.org/">Zenodo</a> archival repository. This way, every time you commit a milestone release, you can mint a new DOI. Then, put your repository into a binder.org container with the <code>holepunch</code> package.</p>
2046+
<p>Use RStudio to manage version control. It’s easy with the <a href="https://usethis.r-lib.org/"><code>usethis</code></a> package (version 2.x or ^.)</p>
2047+
<p>Take your reproducibility to the next level. <a href="https://guides.github.com/activities/citable-code/">Make your code citable</a> by connecting your GitHub repo and your <a href="https://orcid.org/register">ORCID</a> (unique author ID) through to the <a href="https://zenodo.org/">Zenodo</a> archival repository. Now, every time you commit a milestone release, you also mint a DOI.</p>
2048+
<p>Containerize your repository with binder.org using the <a href="https://karthik.github.io/holepunch/"><code>holepunch</code> package</a>.</p>
20792049
<h3 id="setup">Setup</h3>
2080-
<p>To get started, get a free GitHub.com account. Make sure you have the latest versions of R, RStudio, (Rtools if you’re Windows), and usethis. Then, you need to setup your RStudio configuration. Two key documents will help: <a href="https://usethis.r-lib.org/articles/articles/usethis-setup.html">Setup</a>, and <a href="https://usethis.r-lib.org/articles/articles/git-credentials.html">Managing Git(Hub) Credentials</a></p>
2050+
<p>To get started, make a free GitHub.com account. Make sure you have the latest versions of R, RStudio, (Rtools if you’re Windows), and usethis. Then, setup your RStudio configuration using two key documents: <a href="https://usethis.r-lib.org/articles/articles/usethis-setup.html">Setup</a>, and <a href="https://usethis.r-lib.org/articles/articles/git-credentials.html">Managing Git(Hub) Credentials</a>.</p>
20812051
<h3 id="tips">Tips</h3>
20822052
<h4 id="clone-or-fork-from-github">Clone or fork from GitHub</h4>
2083-
<pre><code>usethis::create_from_github(&quot;https://github.com/data-and-visualization/git-tutorial&quot;)</code></pre>
2053+
<div class="layout-chunk" data-layout="l-body">
2054+
<div class="sourceCode">
2055+
<pre><code><span class='fu'>usethis</span><span class='fu'>::</span><span class='fu'><a href='https://usethis.r-lib.org/reference/create_from_github.html'>create_from_github</a></span><span class='op'>(</span><span class='st'>"https://github.com/data-and-visualization/git-tutorial"</span><span class='op'>)</span>
2056+
</code></pre>
2057+
</div>
2058+
</div>
20842059
<h4 id="create-the-github-repo-from-local">Create the GitHub repo from local</h4>
2085-
<pre><code>library(usethis)
2086-
use_git() # initialize a git repo
2087-
use_git_ignore()
2088-
use_readme.Rmd()
2089-
use_ccby_license()
2090-
use_github() # Connect local repo to GitHub</code></pre>
2060+
<div class="layout-chunk" data-layout="l-body">
2061+
<div class="sourceCode">
2062+
<pre><code><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://usethis.r-lib.org'>usethis</a></span><span class='op'>)</span>
2063+
<span class='fu'><a href='https://usethis.r-lib.org/reference/use_git.html'>use_git</a></span><span class='op'>(</span><span class='op'>)</span> <span class='co'># initialize a git repo</span>
2064+
<span class='fu'><a href='https://usethis.r-lib.org/reference/use_git_ignore.html'>use_git_ignore</a></span><span class='op'>(</span><span class='op'>)</span>
2065+
<span class='fu'>use_readme.Rmd</span><span class='op'>(</span><span class='op'>)</span>
2066+
<span class='fu'><a href='https://usethis.r-lib.org/reference/licenses.html'>use_ccby_license</a></span><span class='op'>(</span><span class='op'>)</span>
2067+
<span class='fu'><a href='https://usethis.r-lib.org/reference/use_github.html'>use_github</a></span><span class='op'>(</span><span class='op'>)</span> <span class='co'># Connect local repo to GitHub</span>
2068+
</code></pre>
2069+
</div>
2070+
</div>
20912071
<h4 id="set-up-git-and-manage-github-credentials">set-up git and manage GitHub credentials</h4>
2092-
<pre><code># Sign-in to your GitHub account
2093-
# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html
2094-
# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html
2095-
usethis::create_github_token()
2096-
gitcreds::gitcreds_set()
2097-
gh::gh_whoami()
2098-
usethis::git_sitrep()
2099-
usethis::use_git_config(user.name = &quot;Jane Doe&quot;, user.email = &quot;[email protected]&quot;)
2100-
gh::git_sitrep()</code></pre>
2072+
<div class="layout-chunk" data-layout="l-body">
2073+
<div class="sourceCode">
2074+
<pre><code><span class='co'># Sign-in to your GitHub account</span>
2075+
<span class='co'># Read: https://usethis.r-lib.org/articles/articles/git-credentials.html</span>
2076+
<span class='co'># Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html</span>
2077+
<span class='fu'>usethis</span><span class='fu'>::</span><span class='fu'><a href='https://usethis.r-lib.org/reference/github-token.html'>create_github_token</a></span><span class='op'>(</span><span class='op'>)</span>
2078+
<span class='fu'>gitcreds</span><span class='fu'>::</span><span class='fu'><a href='https://rdrr.io/pkg/gitcreds/man/gitcreds_get.html'>gitcreds_set</a></span><span class='op'>(</span><span class='op'>)</span>
2079+
<span class='fu'>gh</span><span class='fu'>::</span><span class='fu'><a href='https://gh.r-lib.org/reference/gh_whoami.html'>gh_whoami</a></span><span class='op'>(</span><span class='op'>)</span>
2080+
<span class='fu'>usethis</span><span class='fu'>::</span><span class='fu'><a href='https://usethis.r-lib.org/reference/git_sitrep.html'>git_sitrep</a></span><span class='op'>(</span><span class='op'>)</span>
2081+
<span class='fu'>usethis</span><span class='fu'>::</span><span class='fu'><a href='https://usethis.r-lib.org/reference/use_git_config.html'>use_git_config</a></span><span class='op'>(</span>user.name <span class='op'>=</span> <span class='st'>"Jane Doe"</span>, user.email <span class='op'>=</span> <span class='st'>"[email protected]"</span><span class='op'>)</span>
2082+
<span class='fu'>gh</span><span class='fu'>::</span><span class='fu'>git_sitrep</span><span class='op'>(</span><span class='op'>)</span>
2083+
</code></pre>
2084+
</div>
2085+
</div>
21012086
<h4 id="publish-your-code-in-a-binder.org-container">Publish your code in a binder.org container</h4>
21022087
<p>Use the <a href="https://karthik.github.io/holepunch/"><code>holepunch</code> package</a></p>
2103-
<pre><code>library(holepunch)
2104-
2105-
write_compendium_description()
2106-
write_dockerfile()
2107-
generate_badge()
2108-
build_binder()
2088+
<div class="layout-chunk" data-layout="l-body">
2089+
<div class="sourceCode">
2090+
<pre><code><span class='kw'><a href='https://rdrr.io/r/base/library.html'>library</a></span><span class='op'>(</span><span class='va'><a href='https://github.com/karthik/holepunch'>holepunch</a></span><span class='op'>)</span>
2091+
2092+
<span class='fu'><a href='https://rdrr.io/pkg/holepunch/man/write_compendium_description.html'>write_compendium_description</a></span><span class='op'>(</span><span class='op'>)</span>
2093+
<span class='fu'><a href='https://rdrr.io/pkg/holepunch/man/write_dockerfile.html'>write_dockerfile</a></span><span class='op'>(</span><span class='op'>)</span>
2094+
<span class='fu'><a href='https://rdrr.io/pkg/holepunch/man/generate_badge.html'>generate_badge</a></span><span class='op'>(</span><span class='op'>)</span>
2095+
<span class='fu'><a href='https://rdrr.io/pkg/holepunch/man/build_binder.html'>build_binder</a></span><span class='op'>(</span><span class='op'>)</span>
21092096
</code></pre>
2110-
<p>The old documentation from this site can be found in the <a href="https://github.com/data-and-visualization/git-tutorial/releases/tag/v0.9.2019">v.0.2019 release</a> on GitHub.</p>
2111-
<div class="sourceCode" id="cb5"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
2097+
</div>
2098+
</div>
2099+
<hr />
2100+
<p><em>The old documentation from this site can be found in the <a href="https://github.com/data-and-visualization/git-tutorial/releases/tag/v0.9.2019">v.0.2019 release</a> on GitHub</em>.</p>
2101+
<div class="sourceCode" id="cb1"><pre class="sourceCode r distill-force-highlighting-css"><code class="sourceCode r"></code></pre></div>
21122102
<!--radix_placeholder_article_footer-->
21132103
<!--/radix_placeholder_article_footer-->
21142104
</div>
@@ -2117,38 +2107,24 @@ <h4 id="publish-your-code-in-a-binder.org-container">Publish your code in a bind
21172107
</div>
21182108

21192109

2120-
&nbsp;
2121-
2122-
<hr>
2123-
<span class="footer">
2124-
2125-
<span class="left-foot">
2126-
2127-
<a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a> -- an R Learning Series<br>
2128-
<a href="http://library.duke.edu/data/">Center for Data & Visualization Sciences</a><br>
2129-
<a href="http://library.duke.edu/">Duke University Libraries</a>
2130-
2131-
</span>
2132-
2133-
<span class="right-foot">
2134-
2135-
<span class="cc">
2136-
<br>
2137-
<!-- Key: a: SA, b: BY, c: CC Circle, d: ND, n: NC, m: Sampling, s: Share, r: Remix, C: CC Full Logo -->
2138-
C bn</span><br>
2139-
Shareable via Creative Commons: CC <a href="https://creativecommons.org/licenses/by-nc/4.0/">By-NC</a>
2140-
2141-
</span>
2142-
2143-
</span>
21442110
<!--radix_placeholder_site_after_body-->
21452111
<!--/radix_placeholder_site_after_body-->
21462112
<!--radix_placeholder_appendices-->
2147-
<div class="appendix-bottom"></div>
2113+
<div class="appendix-bottom">
2114+
<h3 id="updates-and-corrections">Corrections</h3>
2115+
<p>If you see mistakes or want to suggest changes, please <a href="https://github.com/data-and-visualization/git-tutorial/issues/new">create an issue</a> on the source repository.</p>
2116+
<h3 id="reuse">Reuse</h3>
2117+
<p>Text and figures are licensed under Creative Commons Attribution <a rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>. Source code is available at <a href="https://github.com/data-and-visualization/git-tutorial">https://github.com/data-and-visualization/git-tutorial</a>, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".</p>
2118+
</div>
21482119
<!--/radix_placeholder_appendices-->
21492120
<!--radix_placeholder_navigation_after_body-->
2121+
<div class="distill-site-nav distill-site-footer">
2122+
<p><a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a></p>
2123+
<p><a href="https://library.duke.edu/data/">Center for Data &amp; Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke University Libraries</a></p>
2124+
</div>
21502125
<!--/radix_placeholder_navigation_after_body-->
21512126

2127+
21522128
</body>
21532129

21542130
</html>

docs/resources.html

Lines changed: 17 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@
8888
<title>RStudio &amp; Version Control: Resources</title>
8989

9090

91+
<link rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/"/>
92+
<link rel="icon" type="image/png" href="libs-local/rfun_logo.png"/>
9193

9294

9395
<!-- https://developers.facebook.com/docs/sharing/webmasters#markup -->
@@ -99,6 +101,7 @@
99101
<!-- https://dev.twitter.com/cards/types/summary -->
100102
<meta property="twitter:card" content="summary"/>
101103
<meta property="twitter:title" content="RStudio &amp; Version Control: Resources"/>
104+
<meta property="twitter:site" content="@duke_data"/>
102105

103106
<!--/radix_placeholder_meta_tags-->
104107
<!--radix_placeholder_rmarkdown_metadata-->
@@ -1992,42 +1995,8 @@ <h3>${suggestion.title}</h3>
19921995
<script src="site_libs/webcomponents-2.0.0/webcomponents.js"></script>
19931996
<script src="site_libs/distill-2.2.21/template.v2.js"></script>
19941997
<!--radix_placeholder_site_in_header-->
1995-
<style type="text/css">
1996-
@font-face {
1997-
font-family: 'CC-ICONS';
1998-
font-style: normal;
1999-
/* font-weight: normal; */
2000-
src: url('cc-icons.ttf') format('truetype');
2001-
}
2002-
2003-
2004-
.cc {
2005-
font-family: 'CC-ICONS';
2006-
color: #0736A4;
2007-
font-size: 200%;
2008-
}
2009-
2010-
.footer {
2011-
display: table;
2012-
/* border: 1px solid #666; */
2013-
padding: 20px; /* Apply cell padding */
2014-
width: 95%;
2015-
opacity: 0.65;
2016-
}
2017-
2018-
.left-foot {
2019-
display: table-cell;
2020-
text-align: left;
2021-
}
2022-
2023-
.right-foot {
2024-
display: table-cell;
2025-
text-align: right;
2026-
}
2027-
</style>
20281998
<!--/radix_placeholder_site_in_header-->
20291999

2030-
<link rel="stylesheet" href="libs-local\cc-fonts.css" type="text/css"/>
20312000

20322001
</head>
20332002

@@ -2048,9 +2017,9 @@ <h3>${suggestion.title}</h3>
20482017
<img src="libs-local/rfun_logo.png" alt="Logo"/>
20492018
</a>
20502019
<a href="index.html" class="title">RStudio &amp; Version Control</a>
2051-
<a href="resources.html">Resources</a>
20522020
</div>
20532021
<div class="nav-right">
2022+
<a href="resources.html">Resources</a>
20542023
<a href="https://github.com/data-and-visualization/git-tutorial/">
20552024
<i class="fa fa-github" aria-hidden="true"></i>
20562025
</a>
@@ -2089,9 +2058,10 @@ <h2 id="gui-git-clients">GUI Git Clients</h2>
20892058
<li>GitKracken – <strong>Free</strong> if you have the <a href="https://education.github.com/pack">GitHub Student</a> Pack or the <a href="https://www.gitkraken.com/github-teacher-toolbox">GitHub Teacher toolbox</a></li>
20902059
<li><a href="https://www.sourcetreeapp.com/">SourceTree</a> – Free. (defaults to use with <a href="https://bitbucket.org/">BitBucket</a>)</li>
20912060
</ul>
2092-
<h3 id="usethis-package">Usethis Package</h3>
2061+
<h3 id="packages">Packages</h3>
20932062
<ul>
20942063
<li><a href="https://usethis.r-lib.org/" class="uri">https://usethis.r-lib.org/</a></li>
2064+
<li><a href="https://karthik.github.io/holepunch/"><code>holepunch</code></a> to make your reproducible code a container on binder.org</li>
20952065
</ul>
20962066
<h3 id="free-book">Free Book</h3>
20972067
<ul>
@@ -2116,38 +2086,24 @@ <h2 id="reproducibility">Reproducibility</h2>
21162086
</div>
21172087

21182088

2119-
&nbsp;
2120-
2121-
<hr>
2122-
<span class="footer">
2123-
2124-
<span class="left-foot">
2125-
2126-
<a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a> -- an R Learning Series<br>
2127-
<a href="http://library.duke.edu/data/">Center for Data & Visualization Sciences</a><br>
2128-
<a href="http://library.duke.edu/">Duke University Libraries</a>
2129-
2130-
</span>
2131-
2132-
<span class="right-foot">
2133-
2134-
<span class="cc">
2135-
<br>
2136-
<!-- Key: a: SA, b: BY, c: CC Circle, d: ND, n: NC, m: Sampling, s: Share, r: Remix, C: CC Full Logo -->
2137-
C bn</span><br>
2138-
Shareable via Creative Commons: CC <a href="https://creativecommons.org/licenses/by-nc/4.0/">By-NC</a>
2139-
2140-
</span>
2141-
2142-
</span>
21432089
<!--radix_placeholder_site_after_body-->
21442090
<!--/radix_placeholder_site_after_body-->
21452091
<!--radix_placeholder_appendices-->
2146-
<div class="appendix-bottom"></div>
2092+
<div class="appendix-bottom">
2093+
<h3 id="updates-and-corrections">Corrections</h3>
2094+
<p>If you see mistakes or want to suggest changes, please <a href="https://github.com/data-and-visualization/git-tutorial/issues/new">create an issue</a> on the source repository.</p>
2095+
<h3 id="reuse">Reuse</h3>
2096+
<p>Text and figures are licensed under Creative Commons Attribution <a rel="license" href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>. Source code is available at <a href="https://github.com/data-and-visualization/git-tutorial">https://github.com/data-and-visualization/git-tutorial</a>, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".</p>
2097+
</div>
21472098
<!--/radix_placeholder_appendices-->
21482099
<!--radix_placeholder_navigation_after_body-->
2100+
<div class="distill-site-nav distill-site-footer">
2101+
<p><a href="https://rfun.library.duke.edu/">R We Having Fun Yet‽</a></p>
2102+
<p><a href="https://library.duke.edu/data/">Center for Data &amp; Visualization Sciences</a>. <a href="https://library.duke.edu/">Duke University Libraries</a></p>
2103+
</div>
21492104
<!--/radix_placeholder_navigation_after_body-->
21502105

2106+
21512107
</body>
21522108

21532109
</html>

0 commit comments

Comments
 (0)