Skip to content

Commit

Permalink
Initial bits of Pygments support, still need to port existing code ex…
Browse files Browse the repository at this point in the history
…amples
  • Loading branch information
michaelklishin committed Oct 5, 2012
1 parent 1fe265e commit afb8bc3
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 14 deletions.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ auto: true
exclude: [bin, CNAME, Gemfile, Gemfile.lock, README.md]
markdown: rdiscount
permalink: /:title
pygments: true
1 change: 1 addition & 0 deletions _layouts/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link href='/assets/stylesheets/bootstrap.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/bootstrap-responsive.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/sass/styles.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/pygments.css' media='screen' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Signika+Negative:300,400,600' rel='stylesheet' type='text/css' />
<script src='/assets/javascripts/jquery-1.7.min.js' type='text/javascript'></script>
<script src='/assets/javascripts/toc.js'></script>
Expand Down
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link href='/assets/stylesheets/bootstrap.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/bootstrap-responsive.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/sass/styles.css' media='screen' rel='stylesheet' type='text/css' />
<link href='/assets/stylesheets/pygments.css' media='screen' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Signika+Negative:300,400,600' rel='stylesheet' type='text/css' />
<script src='/assets/javascripts/jquery-1.7.min.js' type='text/javascript'></script>
<script src='/assets/javascripts/toc.js'></script>
Expand Down
8 changes: 4 additions & 4 deletions articles/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repl:

You should be greeted with a "`user=>`" prompt. Try it out:

```clojure
<pre>
user=> (+ 1 1)
; 2
user=> (distinct [:a :b :a :c :a :d])
Expand All @@ -40,19 +40,19 @@ user=> (dotimes [i 3]
; Fabulous! 1
; Inconceivable! 2
; nil
```
</pre>


## Your first project

Create your first Clojure program like so:

```bash
{% highlight bash %}
lein new app my-proj
cd my-proj
# Have a look at the "-main" function in src/my_proj/core.clj.
lein run
```
{% endhighlight %}

and see the output from that `println` function call in
my_proj/core.clj!
Expand Down
20 changes: 10 additions & 10 deletions articles/tutorials/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ The syntax for Clojure is like Lisp and is very simple: code is made
up of expressions which are evaluated to some value. Here are some
examples of expressions:

```clojure
5 ; evaluates to 5
"hi" ; evaluates to the string "hi"
{% highlight clojure %}
5 ;= 5
"hi" ;= "hi"
[1 2 3] ; evaluates to the vector `[1 2 3]`
(+ 1 2) ; evaluates to the sum of 1 and 2
(if true "yes" "no") ; evaluates to the string "yes"
(println "hello!") ; evaluates to nil (but also prints "hello!")
```
{% endhighlight %}

(A semicolon starts a single-line comment.)

Expressions can contain sub-expressions:

```clojure
{% highlight clojure %}
(+ 1
(* 2 3)
(/ 10 2)) ; 1 + (2 * 3) + (10 / 2) ==> 12
```
{% endhighlight %}

Expressions in (various types of) brackets are often referred to as
"forms".
Expand Down Expand Up @@ -97,9 +97,9 @@ can try things out while following along.

Identifiers are used to names things. For example, in

```clojure
{% highlight clojure %}
(def the-answer 42)
```
{% endhighlight %}

we've named something "the-answer" and given it the value 42.

Expand Down Expand Up @@ -209,10 +209,10 @@ values.
You generally don't use lists very often for typical sequential data
in your programs:

```clojure
{% highlight clojure %}
(def my-stuff '("shirt" "coat" "hat")) ; Works fine, but ...
(def my-stuff ["shirt" "coat" "hat"]) ; this is more typical usage.
```
{% endhighlight %}

Lists are most often used when treating code itself as just a bunch of
nested lists --- see [Macros](#macros).
Expand Down
61 changes: 61 additions & 0 deletions assets/stylesheets/pygments.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.hll { background-color: #ffffcc }
.c { color: #408080; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
.cp { color: #BC7A00 } /* Comment.Preproc */
.c1 { color: #408080; font-style: italic } /* Comment.Single */
.cs { color: #408080; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #FF0000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #00A000 } /* Generic.Inserted */
.go { color: #808080 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0040D0 } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #7D9029 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #999999; font-weight: bold } /* Name.Entity */
.ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #A0A000 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #BB6688 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.il { color: #666666 } /* Literal.Number.Integer.Long */

0 comments on commit afb8bc3

Please sign in to comment.