Loading _config.yml +2 −2 Original line number Diff line number Diff line Loading @@ -74,5 +74,5 @@ exclude: - Makefile - bin # Turn off built-in syntax highlighting. highlighter: false # Turn on built-in syntax highlighting. highlighter: rouge _episodes/02-tooling.md +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ is translated into: </body> </html> ~~~ {: .source} {: .html} > ## Back in the Day... > Loading _episodes/04-formatting.md +63 −16 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ which is rendered as: for thing in collection: do_something ~~~ {: .source} {: .language-python} The class specified at the bottom using an opening curly brace and colon, the class identifier with a leading dot, Loading @@ -159,23 +159,70 @@ The [template]({{ site.template_repo }}) provides three styles for code blocks: ~~~ {: .error} The following styles are all synonyms for `.source`; please use them where possible to indicate the type of source being displayed, in case we decide to adopt syntax highlighting at some point: ### Syntax Highlighting The following styles like `.source`, but include syntax highlighting for the specified language. Please use them where possible to indicate the type of source being displayed, and to make code easier to read. `.language-bash`: Bash shell commands: ~~~ echo "Hello World" ~~~ {: .language-bash} `.html`: HTML source: ~~~ <html> <body> <em>Hello World</em> </body> </html> ~~~ {: .html} `.language-make`: Makefiles: ~~~ all: g++ main.cpp hello.cpp -o hello ~~~ {: .language-make} `.language-matlab`: MATLAB source: ~~~ disp('Hello, world!') ~~~ {: .language-matlab} `.language-python`: Python source: ~~~ print("Hello World") ~~~ {: .language-python} `.language-r`: R source: ~~~ cat("Hello World") ~~~ {: .language-r} `.language-sql`: SQL source: ~~~ CREATE PROCEDURE HelloWorld AS PRINT 'Hello, world!' RETURN (0) ~~~ {: .language-sql} * `.bash`: Bash shell commands * `.make`: Makefiles * `.matlab`: MATLAB source * `.python`: Python source * `.r`: R source * `.sql`: SQL source > ## Why No Syntax Highlighting? > > We do not use syntax highlighting for code blocks > because some learners' systems won't do it, > or will do it differently than what they see on screen. {: .callout} ## Special Blockquotes Loading _episodes/05-rmarkdown-example.md +6 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ each episode written in RMarkdown. ~~~ source("../bin/chunk-options.R") ~~~ {: .r} {: .language-r} The rest of the lesson should be written as a normal RMarkdown file. You can include chunk for codes, just like you'd normally do. Loading @@ -44,7 +44,7 @@ Normal output: ~~~ 1 + 1 ~~~ {: .r} {: .language-r} Loading @@ -59,7 +59,7 @@ Output with error message: ~~~ x[10] ~~~ {: .r} {: .language-r} Loading @@ -76,7 +76,7 @@ library(ggplot2) ggplot(diamonds, aes(x = carat, y = price, color = cut)) + geom_point() ~~~ {: .r} {: .language-r} <img src="../fig/rmd-plot-example-1.png" title="plot of chunk plot-example" alt="plot of chunk plot-example" style="display: block; margin: auto;" /> Loading @@ -93,7 +93,7 @@ instructions and solutions. For instance this: > ~~~ > paste("This", "new", "template", "looks", "good") > ~~~ > {: .r} > {: .language-r} > > > ## Solution > > Loading @@ -116,7 +116,7 @@ will generate this: > ~~~ > paste("This", "new", "template", "looks", "good") > ~~~ > {: .r} > {: .language-r} > > > ## Solution > > Loading _episodes/06-style-guide.md +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ For example, "to delete the cell press <kbd>D</kbd>" should be write as ~~~ to delete the cell press <kbd>D</kbd> ~~~ {: .html} The table below covers most of the keyboard key labels. Loading Loading @@ -79,5 +80,6 @@ For example, "press <kbd>Ctrl</kbd>+<kbd>X</kbd> to quit nano" should be write a ~~~ press <kbd>Ctrl</kbd>+<kbd>X</kbd> to quit nano. ~~~ {: .html} {% include links.md %} Loading
_config.yml +2 −2 Original line number Diff line number Diff line Loading @@ -74,5 +74,5 @@ exclude: - Makefile - bin # Turn off built-in syntax highlighting. highlighter: false # Turn on built-in syntax highlighting. highlighter: rouge
_episodes/02-tooling.md +1 −1 Original line number Diff line number Diff line Loading @@ -128,7 +128,7 @@ is translated into: </body> </html> ~~~ {: .source} {: .html} > ## Back in the Day... > Loading
_episodes/04-formatting.md +63 −16 Original line number Diff line number Diff line Loading @@ -137,7 +137,7 @@ which is rendered as: for thing in collection: do_something ~~~ {: .source} {: .language-python} The class specified at the bottom using an opening curly brace and colon, the class identifier with a leading dot, Loading @@ -159,23 +159,70 @@ The [template]({{ site.template_repo }}) provides three styles for code blocks: ~~~ {: .error} The following styles are all synonyms for `.source`; please use them where possible to indicate the type of source being displayed, in case we decide to adopt syntax highlighting at some point: ### Syntax Highlighting The following styles like `.source`, but include syntax highlighting for the specified language. Please use them where possible to indicate the type of source being displayed, and to make code easier to read. `.language-bash`: Bash shell commands: ~~~ echo "Hello World" ~~~ {: .language-bash} `.html`: HTML source: ~~~ <html> <body> <em>Hello World</em> </body> </html> ~~~ {: .html} `.language-make`: Makefiles: ~~~ all: g++ main.cpp hello.cpp -o hello ~~~ {: .language-make} `.language-matlab`: MATLAB source: ~~~ disp('Hello, world!') ~~~ {: .language-matlab} `.language-python`: Python source: ~~~ print("Hello World") ~~~ {: .language-python} `.language-r`: R source: ~~~ cat("Hello World") ~~~ {: .language-r} `.language-sql`: SQL source: ~~~ CREATE PROCEDURE HelloWorld AS PRINT 'Hello, world!' RETURN (0) ~~~ {: .language-sql} * `.bash`: Bash shell commands * `.make`: Makefiles * `.matlab`: MATLAB source * `.python`: Python source * `.r`: R source * `.sql`: SQL source > ## Why No Syntax Highlighting? > > We do not use syntax highlighting for code blocks > because some learners' systems won't do it, > or will do it differently than what they see on screen. {: .callout} ## Special Blockquotes Loading
_episodes/05-rmarkdown-example.md +6 −6 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ each episode written in RMarkdown. ~~~ source("../bin/chunk-options.R") ~~~ {: .r} {: .language-r} The rest of the lesson should be written as a normal RMarkdown file. You can include chunk for codes, just like you'd normally do. Loading @@ -44,7 +44,7 @@ Normal output: ~~~ 1 + 1 ~~~ {: .r} {: .language-r} Loading @@ -59,7 +59,7 @@ Output with error message: ~~~ x[10] ~~~ {: .r} {: .language-r} Loading @@ -76,7 +76,7 @@ library(ggplot2) ggplot(diamonds, aes(x = carat, y = price, color = cut)) + geom_point() ~~~ {: .r} {: .language-r} <img src="../fig/rmd-plot-example-1.png" title="plot of chunk plot-example" alt="plot of chunk plot-example" style="display: block; margin: auto;" /> Loading @@ -93,7 +93,7 @@ instructions and solutions. For instance this: > ~~~ > paste("This", "new", "template", "looks", "good") > ~~~ > {: .r} > {: .language-r} > > > ## Solution > > Loading @@ -116,7 +116,7 @@ will generate this: > ~~~ > paste("This", "new", "template", "looks", "good") > ~~~ > {: .r} > {: .language-r} > > > ## Solution > > Loading
_episodes/06-style-guide.md +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ For example, "to delete the cell press <kbd>D</kbd>" should be write as ~~~ to delete the cell press <kbd>D</kbd> ~~~ {: .html} The table below covers most of the keyboard key labels. Loading Loading @@ -79,5 +80,6 @@ For example, "press <kbd>Ctrl</kbd>+<kbd>X</kbd> to quit nano" should be write a ~~~ press <kbd>Ctrl</kbd>+<kbd>X</kbd> to quit nano. ~~~ {: .html} {% include links.md %}