Skip to content

Commit

Permalink
added code for r users to download good-enough-project-template
Browse files Browse the repository at this point in the history
  • Loading branch information
nehamoopen committed Nov 28, 2022
1 parent 6d35e9a commit 32f8fd9
Show file tree
Hide file tree
Showing 36 changed files with 7,613 additions and 832 deletions.
11 changes: 11 additions & 0 deletions 04-project-management.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ _NB: You can check the slides for more detail._

* Use the instructions [on this slide](../slides/slides_project-setup.html#6) to clone a template repository of a project folder structure to your computer. Remember to also follow the instructions on removing the .git folder that is downloaded.

* R users can also use the following code:

```{r eval=FALSE, echo=TRUE}
# install.packages("usethis")
usethis::use_zip("https://github.com/bvreede/good-enough-project-template/archive/refs/heads/master.zip",
destdir = getwd())
```


* Place your project files in the right folder.

* Adjust paths in your code, and be sure to use relative paths!
Expand Down
176 changes: 89 additions & 87 deletions docs/2-acknowledgements.html

Large diffs are not rendered by default.

180 changes: 91 additions & 89 deletions docs/3-preparation.html

Large diffs are not rendered by default.

337 changes: 337 additions & 0 deletions docs/3.1-data-andor-code.html

Large diffs are not rendered by default.

339 changes: 339 additions & 0 deletions docs/3.2-terminal.html

Large diffs are not rendered by default.

497 changes: 497 additions & 0 deletions docs/3.3-git.html

Large diffs are not rendered by default.

401 changes: 401 additions & 0 deletions docs/3.4-final-test.html

Large diffs are not rendered by default.

184 changes: 93 additions & 91 deletions docs/4-introduction.html

Large diffs are not rendered by default.

431 changes: 431 additions & 0 deletions docs/4.1-schedule.html

Large diffs are not rendered by default.

354 changes: 354 additions & 0 deletions docs/4.2-course-materials.html

Large diffs are not rendered by default.

336 changes: 336 additions & 0 deletions docs/404.html

Large diffs are not rendered by default.

184 changes: 93 additions & 91 deletions docs/5-project-management.html

Large diffs are not rendered by default.

365 changes: 365 additions & 0 deletions docs/5.1-project-setup.html

Large diffs are not rendered by default.

362 changes: 362 additions & 0 deletions docs/5.2-version-control.html

Large diffs are not rendered by default.

357 changes: 357 additions & 0 deletions docs/5.3-publication-licensing.html

Large diffs are not rendered by default.

184 changes: 93 additions & 91 deletions docs/6-code-quality.html

Large diffs are not rendered by default.

358 changes: 358 additions & 0 deletions docs/6.1-readability.html

Large diffs are not rendered by default.

357 changes: 357 additions & 0 deletions docs/6.2-reusability.html

Large diffs are not rendered by default.

373 changes: 373 additions & 0 deletions docs/6.3-robustness.html

Large diffs are not rendered by default.

184 changes: 93 additions & 91 deletions docs/7-documentation.html

Large diffs are not rendered by default.

360 changes: 360 additions & 0 deletions docs/7.1-comments-and-docstrings.html

Large diffs are not rendered by default.

365 changes: 365 additions & 0 deletions docs/7.2-the-readme-page.html

Large diffs are not rendered by default.

184 changes: 93 additions & 91 deletions docs/8-accessibility-reproducibility.html

Large diffs are not rendered by default.

357 changes: 357 additions & 0 deletions docs/8.1-dependencies.html

Large diffs are not rendered by default.

361 changes: 361 additions & 0 deletions docs/8.2-binder.html

Large diffs are not rendered by default.

356 changes: 356 additions & 0 deletions docs/8.3-archiving.html

Large diffs are not rendered by default.

180 changes: 91 additions & 89 deletions docs/9-references.html

Large diffs are not rendered by default.

178 changes: 90 additions & 88 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections-hash.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Styles for section anchors */
a.anchor-section::before {content: '#';font-size: 80%;}
4 changes: 4 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Styles for section anchors */
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
.hasAnchor:hover a.anchor-section {visibility: visible;}
ul > li > .anchor-section {display: none;}
11 changes: 11 additions & 0 deletions docs/libs/anchor-sections-1.1.0/anchor-sections.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
document.addEventListener('DOMContentLoaded', function () {
// If section divs is used, we need to put the anchor in the child header
const headers = document.querySelectorAll("div.hasAnchor.section[class*='level'] > :first-child")

headers.forEach(function (x) {
// Add to the header node
if (!x.classList.contains('hasAnchor')) x.classList.add('hasAnchor')
// Remove from the section or div created by Pandoc
x.parentElement.classList.remove('hasAnchor')
})
})
6 changes: 6 additions & 0 deletions docs/libs/gitbook-2.6.7/css/plugin-bookdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ div.proof>*:last-child:after {
.header-section-number {
padding-right: .5em;
}
#header .multi-author {
margin: 0.5em 0 -0.5em 0;
}
#header .date {
margin-top: 1.5em;
}
93 changes: 70 additions & 23 deletions docs/libs/gitbook-2.6.7/js/plugin-search.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
var index = null;
var fuse = null;
var _search = {engine: 'lunr', opts: {}};
var $searchInput, $searchLabel, $searchForm;
var $highlighted = [], hi, hiOpts = { className: 'search-highlight' };
var collapse = false, toc_visible = [];

function init(config) {
// Instantiate search settings
_search = gitbook.storage.get("search", {
engine: config.search.engine || 'lunr',
opts: config.search.options || {},
});
};

// Save current search settings
function saveSearchSettings() {
gitbook.storage.set("search", _search);
}

// Use a specific index
function loadIndex(data) {
// [Yihui] In bookdown, I use a character matrix to store the chapter
Expand All @@ -14,18 +29,36 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
// lunr cannot handle non-English text very well, e.g. the default
// tokenizer cannot deal with Chinese text, so we may want to replace
// lunr with a dumb simple text matching approach.
index = lunr(function () {
this.ref('url');
this.field('title', { boost: 10 });
this.field('body');
});
data.map(function(item) {
index.add({
url: item[0],
title: item[1],
body: item[2]
if (_search.engine === 'lunr') {
index = lunr(function () {
this.ref('url');
this.field('title', { boost: 10 });
this.field('body');
});
});
data.map(function(item) {
index.add({
url: item[0],
title: item[1],
body: item[2]
});
});
return;
}
fuse = new Fuse(data.map((_data => {
return {
url: _data[0],
title: _data[1],
body: _data[2]
};
})), Object.assign(
{
includeScore: true,
threshold: 0.1,
ignoreLocation: true,
keys: ["title", "body"]
},
_search.opts
));
}

// Fetch the search index
Expand All @@ -36,20 +69,33 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {

// Search for a term and return results
function search(q) {
if (!index) return;

var results = _.chain(index.search(q))
.map(function(result) {
var parts = result.ref.split("#");
return {
path: parts[0],
hash: parts[1]
};
})
.value();
let results = [];
switch (_search.engine) {
case 'fuse':
if (!fuse) return;
results = fuse.search(q).map(function(result) {
var parts = result.item.url.split('#');
return {
path: parts[0],
hash: parts[1]
};
});
break;
case 'lunr':
default:
if (!index) return;
results = _.chain(index.search(q)).map(function(result) {
var parts = result.ref.split("#");
return {
path: parts[0],
hash: parts[1]
};
})
.value();
}

// [Yihui] Highlight the search keyword on current page
$highlighted = results.length === 0 ? [] : $('.page-inner')
$highlighted = $('.page-inner')
.unhighlight(hiOpts).highlight(q, hiOpts).find('span.search-highlight');
scrollToHighlighted(0);

Expand Down Expand Up @@ -172,6 +218,7 @@ gitbook.require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
gitbook.events.bind("start", function(e, config) {
// [Yihui] disable search
if (config.search === false) return;
init(config);
collapse = !config.toc || config.toc.collapse === 'section' ||
config.toc.collapse === 'subsection';

Expand Down
2 changes: 2 additions & 0 deletions docs/libs/jquery-3.6.0/jquery-3.6.0.min.js

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions docs/libs/vembedr-0.1.5/css/vembedr.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.vembedr {
margin-bottom: 10px;
}

.vembedr-rounded {
display: inline-block;
border-radius: 15px;
overflow: hidden;
}

.vembedr-rounded iframe {
display: block;
border: none;
}
2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

0 comments on commit 32f8fd9

Please sign in to comment.