Commit 3a2c9dcc authored by naught101's avatar naught101 Committed by Raniere Silva
Browse files

Enable syntax highlighting

parent 9b27e176
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -74,5 +74,5 @@ exclude:
  - Makefile
  - bin

# Turn off built-in syntax highlighting.
highlighter: false
# Turn on built-in syntax highlighting.
highlighter: rouge
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ is translated into:
</body>
</html>
~~~
{: .source}
{: .html}

> ## Back in the Day...
>
+63 −16
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ which is rendered as:
for thing in collection:
    do_something
~~~
{: .source}
{: .python}

The class specified at the bottom using an opening curly brace and colon,
the class identifier with a leading dot,
@@ -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

+6 −6
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ new lesson is `data-cleanup`.
    ~~~
    $ git clone -b gh-pages https://github.com/timtomch/data-cleanup.git
    ~~~
    {: .source}
    {: .bash}

    Note that the URL for your lesson will have your username and chosen repository name.

@@ -64,7 +64,7 @@ new lesson is `data-cleanup`.
    ~~~
    $ cd data-cleanup
    ~~~
    {: .source}
    {: .bash}

    Note that the name of your directory should be what you named your lesson 
    on the example this is `data-cleanup`.
@@ -75,7 +75,7 @@ new lesson is `data-cleanup`.
    ~~~
    $ git remote add template https://github.com/swcarpentry/styles.git
    ~~~
    {: .source}
    {: .bash}

    This will allow you to pull in changes made to the template,
    such as improvements to our CSS style files.
@@ -87,7 +87,7 @@ new lesson is `data-cleanup`.
    ~~~
    $ git checkout gh-pages
    ~~~
    {: .source}
    {: .bash}

	This will ensure that you are using the most "stable" version of the
	template repository. Since it's being actively maintained by the
@@ -107,7 +107,7 @@ new lesson is `data-cleanup`.
    ~~~
    $ make serve
    ~~~
    {: .source}
    {: .bash}

14. Commit your changes *and the HTML pages in the root directory of
    your lesson repository* and push to the `gh-pages` branch of your
@@ -119,7 +119,7 @@ new lesson is `data-cleanup`.
    $ git commit -m "Explanatory message"
    $ git push origin gh-pages
    ~~~
    {: .source}
    {: .bash}

15. [Tell us][contact] where your lesson is so that we can add it to
    the appropriate index page(s).