Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

Commit

Permalink
Preparing material for Version 5 novice release
Browse files Browse the repository at this point in the history
  • Loading branch information
gvwilson committed Feb 7, 2014
1 parent 5b89d03 commit b66851c
Show file tree
Hide file tree
Showing 138 changed files with 30,697 additions and 1,139 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
_site
tmp
image-page.html
# For the misc-r/full-R-bootcamp
tmp-book.*
patched-gloss.md
*/*/*_files
lessons/misc-r/full-R-bootcamp/R-basics/01-basics-of-R.md
lessons/misc-r/full-R-bootcamp/R-basics/rstudio-basics.md
lessons/misc-r/full-R-bootcamp/R-basics/02-data-structures.md
Expand Down
12 changes: 4 additions & 8 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
---
Licenses
========
## Licenses

Instructional Material
----------------------
### Instructional Material

All Software Carpentry instructional material is made available under
the Creative Commons Attribution license. You are free:
Expand Down Expand Up @@ -37,8 +35,7 @@ With the understanding that:
For the full legal text of this license, please see
[http://creativecommons.org/licenses/by/3.0/legalcode](http://creativecommons.org/licenses/by/3.0/legalcode).

Software
--------
### Software

Except where otherwise noted, the example programs and other software
provided by Software Carpentry are made available under the
Expand All @@ -64,8 +61,7 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Trademark
---------
### Trademark

"Software Carpentry" and the Software Carpentry logo are registered
trademarks of Software Carpentry, Ltd.
154 changes: 102 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,85 +1,122 @@
#-----------------------------------------------------------
# Re-make lecture materials.
#
# We use Jekyll to compile HTML and Markdown files into their final
# form, and nbconvert to translate IPython Notebooks to theirs. The
# problem is that Jekyll always erases and re-creates the output
# directory, so any compiled notebooks we put there are lost when we
# run it. The solution is to cache compiled notebooks in a temporary
# directory, and copy those compiled pages into the output directory
# as needed.
#-----------------------------------------------------------

# Directories.
OUT = _site
TMP = tmp
LINK_OUT = /tmp/bc-links
BOOK = _book

# Source and destination Markdown/HTML pages.
# Source Markdown pages.
MARKDOWN_SRC = \
LICENSE.md \
NEW_MATERIAL.md \
bib.md \
gloss.md \
rules.md \
setup.md \
$(wildcard shell/novice/*.md) \
$(wildcard git/novice/*.md) \
$(wildcard python/novice/*.md) \
$(wildcard sql/novice/*.md)
MARKDOWN_DST = \
$(patsubst %.md,$(OUT)/%.html,$(MARKDOWN_SRC))
$(wildcard sql/novice/*.md) \
$(wildcard teaching/novice/*.md)

# Source, cached, and destination Notebook files/HTML pages.
NOTEBOOK_SRC = \
$(wildcard shell/novice/*.ipynb) \
$(wildcard git/novice/*.ipynb) \
$(wildcard python/novice/*.ipynb) \
$(wildcard sql/novice/*.ipynb)
NOTEBOOK_TMP = \
$(patsubst %.ipynb,$(TMP)/%.html,$(NOTEBOOK_SRC))
NOTEBOOK_DST = \
$(patsubst %.ipynb,$(OUT)/%.html,$(NOTEBOOK_SRC))

# Mark cached versions of compiled notebooks as SECONDARY so that GNU
# Make won't delete them after rebuilding.
.SECONDARY : $(NOTEBOOK_TMP)
$(wildcard python/novice/??-*.ipynb) \
$(wildcard sql/novice/??-*.ipynb)

NOTEBOOK_MD = \
$(patsubst %.ipynb,%.md,$(NOTEBOOK_SRC))

HTML_DST = \
$(patsubst %.md,$(OUT)/%.html,$(MARKDOWN_SRC)) \
$(patsubst %.md,$(OUT)/%.html,$(NOTEBOOK_MD))

BOOK_SRC = \
intro.md \
shell/novice/index.md $(wildcard shell/novice/*-*.md) \
git/novice/index.md $(wildcard git/novice/*-*.md) \
python/novice/index.md $(patsubst %.ipynb,%.md,$(wildcard python/novice/??-*.ipynb)) \
sql/novice/index.md $(patsubst %.ipynb,%.md,$(wildcard sql/novice/??-*.ipynb)) \
extras/novice/index.md $(wildcard extras/novice/*-*.md) \
teaching/novice/index.md $(wildcard teaching/novice/*-*.md) \
ref/novice/index.md $(wildcard ref/novice/*-*.md) \
bib.md \
tmp/gloss.md \
rules.md \
LICENSE.md

BOOK_TMP = \
$(patsubst %,tmp/%,$(BOOK_SRC))

BOOK_DST = $(OUT)/book.html

.SECONDARY : $(NOTEBOOK_MD)

#-----------------------------------------------------------

# Default action: show available commands (marked with double '#').
all : commands

## commands : show all commands
commands :
@grep -E '^##' Makefile | sed -e 's/## //g'
## site : build site.
site : $(OUT)/index.html

## check : build site.
# We know we're done when the compiled IPython Notebook files are
# in the output directory.
check : $(NOTEBOOK_DST)
# Build HTML versions of Markdown source files using Jekyll.
$(OUT)/index.html : $(MARKDOWN_SRC) $(NOTEBOOK_MD)
jekyll -t build -d $(OUT)
mv $(OUT)/NEW_MATERIAL.html $(OUT)/index.html
sed -i -e 's!img src="python/novice/!img src="!g' $(OUT)/python/novice/??-*.html

# Cannot create final versions of compiled notebook files until Jekyll
# has re-created the output directory.
$(NOTEBOOK_DST) : $(OUT)
# Build Markdown versions of IPython Notebooks.
%.md : %.ipynb _templates/ipynb.tpl
ipython nbconvert --template=_templates/ipynb.tpl --to=markdown --output="$(subst .md,,$@)" "$<"

# Copy cached versions of compiled notebook files into output directory.
$(OUT)/%.html : $(TMP)/%.html
cp $< $@
## book : build all-in-one book version of material.
book : $(BOOK_DST)

# Build HTML versions of Markdown source files using Jekyll. This always
# erases and re-creates the output directory.
$(OUT) : $(MARKDOWN_SRC)
jekyll -t build -d $(OUT)
$(BOOK_DST) : $(OUT)/index.html $(BOOK_TMP) _templates/book.tpl tmp/gloss.md bin/make-book.py
python bin/make-book.py $(BOOK_TMP) \
| pandoc --email-obfuscation=none --template=_templates/book.tpl -t html -o - \
| sed -e 's!../../gloss.html#!#g:!g' \
| sed -e 's!../gloss.html#!#g:!g' \
> $@

# Patch targets and links in the glossary for inclusion in the book.
tmp/gloss.md : gloss.md
@mkdir -p $$(dirname $@)
sed -e 's!](#!](#g:!g' -e 's!<a name="!<a name="#g:!g' $< > $@

# Patch image paths in the sections.
tmp/shell/novice/%.md : shell/novice/%.md
@mkdir -p $$(dirname $@)
sed -e 's!<img src="img!<img src="shell/novice/img!g' $< > $@

# Build HTML versions of IPython Notebooks. This is slow, so we cache
# the results in a temporary directory.
$(TMP)/%.html : %.ipynb
tmp/git/novice/%.md : git/novice/%.md
@mkdir -p $$(dirname $@)
ipython nbconvert --output="$(subst .html,,$@)" "$<"
sed -e 's!<img src="img!<img src="git/novice/img!g' $< > $@

tmp/python/novice/%.md : python/novice/%.md
@mkdir -p $$(dirname $@)
sed -e 's!<img src="img!<img src="python/novice/img!g' $< > $@

tmp/sql/novice/%.md : sql/novice/%.md
@mkdir -p $$(dirname $@)
sed -e 's!<img src="img!<img src="sql/novice/img!g' $< > $@

# All other Markdown files used in the book.
tmp/%.md : %.md
@mkdir -p $$(dirname $@)
cp $< $@

#-----------------------------------------------------------

## commands : show all commands
commands :
@grep -E '^##' Makefile | sed -e 's/## //g'

## fixme : find places where fixes are needed.
fixme :
@grep -n FIXME $$(find -f shell git python sql -type f -print | grep -v .ipynb_checkpoints)
@grep -i -n FIXME $$(find -f shell git python sql -type f -print | grep -v .ipynb_checkpoints)

## gloss : check glossary
gloss :
Expand All @@ -97,13 +134,26 @@ images :
links :
@bin/linklint -doc $(LINK_OUT) -textonly -root $(OUT) /@

## valid : check validity of HTML book.
valid : tmp-book.html
xmllint --noout tmp-book.html 2>&1 | python bin/unwarn.py

## clean : clean up
clean :
rm -rf $(OUT) $(TMP) $$(find . -name '*~' -print) $$(find . -name '*.pyc' -print)
clean : tidy
@rm -rf $(OUT) $(NOTEBOOK_MD)

## tidy : clean up intermediate files only
tidy :
@rm -rf \
image-page.html \
tmp \
$$(find . -name '*~' -print) \
$$(find . -name '*.pyc' -print) \
$$(find . -name '??-*_files' -type d -print)

## show : show variables
show :
@echo "MARKDOWN_SRC" $(MARKDOWN_SRC)
@echo "MARKDOWN_DST" $(MARKDOWN_DST)
@echo "NOTEBOOK_SRC" $(NOTEBOOK_SRC)
@echo "NOTEBOOK_DST" $(NOTEBOOK_DST)
@echo "NOTEBOOK_MD" $(NOTEBOOK_MD)
@echo "HTML_DST" $(HTML_DST)
58 changes: 25 additions & 33 deletions NEW_MATERIAL.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
---
layout: lesson
root: .
title: New Material
title: Lessons (Version 5.0 Beta)
---
<table class="table table-striped">
<tr>
<td></td>
<th>Novice</th>
<th>Intermediate</th>
</tr>
<tr>
<th>The Unix Shell</th>
<td><a href="./shell/novice/index.html">X</a></td>
<td>-</td>
</tr>
<tr>
<th>Version Control with Git</th>
<td><a href="./git/novice/index.html">X</a></td>
<td>-</td>
</tr>
<tr>
<th>Programming with Python</th>
<td><a href="./python/novice/index.html">X</a></td>
<td>-</td>
</tr>
<tr>
<th>Programming with R</th>
<td>-</td>
<td>-</td>
</tr>
<tr>
<th>Using Databases and SQL</th>
<td><a href="./sql/novice/index.html">X</a></td>
<td>-</td>
</tr>
</table>
We are currently updating our lessons
to incorporate what we've learned from our learners
in the last four years.

## For Novices

* [Introduction](intro.html)
* [The Unix Shell](shell/novice/index.html)
* [Version Control with Git](git/novice/index.html)
* [Programming with Python](python/novice/index.html)
* [Using Databases and SQL](sql/novice/index.html)
* [A Few Extras](extras/novice/index.html)

These lessons are also available in [book form](book.html).

## For the More Experienced

Under development.

## Other Materials

* [Setup Instructions](setup.html)
* [Recommended Reading](bib.html)
* [Glossary](gloss.html)
4 changes: 4 additions & 0 deletions _layouts/lesson.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@

<div class="row-fluid">
<div class="span10 offset1">
<!-- start content -->
{% if page.title %}
<h1>{{page.title}}</h1>
{% endif %}
{{content}}
<!-- end content -->
</div>
</div>

Expand Down
60 changes: 60 additions & 0 deletions _templates/book.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" />
<link href="./css/bootstrap/bootstrap.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="./css/bootstrap/bootstrap-responsive.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="./css/swc.css" />
<link rel="stylesheet" type="text/css" href="./css/swc-bootstrap.css" />
<link rel="alternate" type="application/rss+xml" title="The Software Carpentry Blog" href="{{config.site}}/feed.xml"/>
<meta charset="UTF-8" />
<meta http-equiv="last-modified" content="{{site.timestamp}}" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>Software Carpentry</title>
</head>
<body>
<div class="container">
<div class="banner">
<a href="http://software-carpentry.org" title="Software Carpentry">
<img alt="Software Carpentry banner" src="./img/software-carpentry-banner.png" />
</a>
</div>
<div class="row-fluid">
<div class="span10 offset1">

<div align="center">
<h1 class="title">Software Carpentry</h1>
<h2 class="subtitle">Volume 1: Basics</h2>
<h2 class="subtitle">Greg Wilson</h2>
</div>

<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#the-unix-shell">The Unix Shell</a></li>
<li><a href="#version-control-with-git">Version Control with Git</a></li>
<li><a href="#programming-with-python">Programming with Python</a></li>
<li><a href="#using-databases-and-sql">Using Databases and SQL</a></li>
<li><a href="#a-few-extras">A Few Extras</a></li>
<li><a href="#instructors-guide">Instructor's Guide</a></li>
<li><a href="#reference">Reference</a></li>
<li><a href="#recommended-reading">Recommended Reading</a></li>
<li><a href="#glossary">Glossary</a></li>
<li><a href="#the-rules">The Rules</a></li>
<li><a href="#licenses">Licenses</a></li>
</ul>

$body$

</div>
</div>
<script src="./js/jquery-1.9.1.min.js"></script>
<script src="./js/bootstrap/bootstrap.min.js"></script>
</div>
</body>
</html>
Loading

0 comments on commit b66851c

Please sign in to comment.