summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-24 19:38:23 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-24 19:38:23 +0100
commit81e3df1e11481f20294fcc8bc96418e40402c6ba (patch)
treea58aa57045bfba18df5f98ca9b4cb36bd9b65ddf
parentfe7182d28856514d2e19a3ef588282129cc21fe2 (diff)
downloadhakyll-81e3df1e11481f20294fcc8bc96418e40402c6ba.tar.gz
Added some different formats in the first example as a demonstration.
-rw-r--r--examples/brochure/about.rst (renamed from examples/brochure/about.markdown)5
-rw-r--r--examples/brochure/code.lhs (renamed from examples/brochure/products.markdown)12
-rw-r--r--examples/brochure/css/syntax.css20
-rw-r--r--examples/brochure/hakyll.hs4
-rw-r--r--examples/brochure/index.markdown7
-rw-r--r--examples/brochure/templates/default.html3
-rw-r--r--examples/hakyll/tutorial1.markdown23
7 files changed, 56 insertions, 18 deletions
diff --git a/examples/brochure/about.markdown b/examples/brochure/about.rst
index 247cb83..99af9e2 100644
--- a/examples/brochure/about.markdown
+++ b/examples/brochure/about.rst
@@ -5,7 +5,10 @@ Nullam imperdiet sodales orci vitae molestie. Nunc quam orci, pharetra a
rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
-accumsan vitae. 碁
+accumsan vitae.
+
+1. Amamus Unicode 碁
+2. Interdum nex magna.
Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
diff --git a/examples/brochure/products.markdown b/examples/brochure/code.lhs
index 64b66f3..e98ec85 100644
--- a/examples/brochure/products.markdown
+++ b/examples/brochure/code.lhs
@@ -1,13 +1,21 @@
---
-title: Products
+title: Code
---
Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
lectus mi egestas nulla, pulvinar lobortis nunc eros id nisl. Curabitur
-imperdiet, erat at accumsan vulputate, purus nunc blandit nulla, dictum
+imperdiet, erat at accumsan vulputate.
+
+> reverse' [] = []
+> reverse' (x:xs) = (reverse' xs) ++ [x]
+
+Purus nunc blandit nulla, dictum.
+
vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
+> main = print $ reverse' [1 .. 10]
+
Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
fringilla tempor ut a nunc. Pellentesque elementum elit lorem.
diff --git a/examples/brochure/css/syntax.css b/examples/brochure/css/syntax.css
new file mode 100644
index 0000000..0dbb47e
--- /dev/null
+++ b/examples/brochure/css/syntax.css
@@ -0,0 +1,20 @@
+/* Generated by pandoc. */
+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
+{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
+td.sourceCode { padding-left: 5px; }
+pre.sourceCode { }
+pre.sourceCode span.Normal { }
+pre.sourceCode span.Keyword { color: #007020; font-weight: bold; }
+pre.sourceCode span.DataType { color: #902000; }
+pre.sourceCode span.DecVal { color: #40a070; }
+pre.sourceCode span.BaseN { color: #40a070; }
+pre.sourceCode span.Float { color: #40a070; }
+pre.sourceCode span.Char { color: #4070a0; }
+pre.sourceCode span.String { color: #4070a0; }
+pre.sourceCode span.Comment { color: #60a0b0; font-style: italic; }
+pre.sourceCode span.Others { color: #007020; }
+pre.sourceCode span.Alert { color: red; font-weight: bold; }
+pre.sourceCode span.Function { color: #06287e; }
+pre.sourceCode span.RegionMarker { }
+pre.sourceCode span.Error { color: red; font-weight: bold; }
diff --git a/examples/brochure/hakyll.hs b/examples/brochure/hakyll.hs
index b2606ba..c550202 100644
--- a/examples/brochure/hakyll.hs
+++ b/examples/brochure/hakyll.hs
@@ -5,7 +5,7 @@ import Text.Hakyll.Renderables (createPagePath)
main = hakyll $ do
directory css "css"
- render "about.markdown"
+ render "about.rst"
render "index.markdown"
- render "products.markdown"
+ render "code.lhs"
where render = renderChain ["templates/default.html"] . createPagePath
diff --git a/examples/brochure/index.markdown b/examples/brochure/index.markdown
index 76ed40c..b5a32c7 100644
--- a/examples/brochure/index.markdown
+++ b/examples/brochure/index.markdown
@@ -5,8 +5,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempor, urna et
auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
-Mauris sit amet justo mi. Curabitur vel quam felis. In hac habitasse platea
-dictumst. Etiam nec consequat risus. Donec consequat est vitae neque fermentum
+- Mauris sit amet justo mi.
+- Curabitur vel quam felis.
+- In hac habitasse platea dictumst.
+
+Etiam nec consequat risus. Donec consequat est vitae neque fermentum
feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
diff --git a/examples/brochure/templates/default.html b/examples/brochure/templates/default.html
index 329dc47..794d449 100644
--- a/examples/brochure/templates/default.html
+++ b/examples/brochure/templates/default.html
@@ -6,13 +6,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MyAweSomeCompany - $title</title>
<link rel="stylesheet" type="text/css" href="$root/css/default.css" />
+ <link rel="stylesheet" type="text/css" href="$root/css/syntax.css" />
</head>
<body>
<h1>MyAweSomeCompany - $title</h1>
<div id="navigation">
<a href="$root/index.html">Home</a>
<a href="$root/about.html">About</a>
- <a href="$root/products.html">Products</a>
+ <a href="$root/code.html">Code</a>
</div>
$body
diff --git a/examples/hakyll/tutorial1.markdown b/examples/hakyll/tutorial1.markdown
index f3c99aa..f228848 100644
--- a/examples/hakyll/tutorial1.markdown
+++ b/examples/hakyll/tutorial1.markdown
@@ -61,10 +61,10 @@ it will generate a very nice main function.
## Pages
An important concept in Hakyll is Pages. Pages are text files that can be
-written in markdown, html or TeX. Furthermore, they can also contain some
-metadata. The metadata is placed in the file header and surrouded by `---`
-lines. Each line should contain a `key: value` pair. Let's have a look at the
-`about.markdown` page.
+written in markdown, html, rst... basically anything Pandoc supports.
+Furthermore, they can also contain some metadata. The metadata is placed in the
+file header and surrouded by `---` lines. Each line should contain a
+`key: value` pair. Let's have a look at the `index.markdown` page.
---
title: About
@@ -91,13 +91,15 @@ html files) containing a number of keys. The syntax for these keys is
<title>MyAweSomeCompany - $title</title>
<link rel="stylesheet" type="text/css"
href="$$root/css/default.css" />
+ <link rel="stylesheet" type="text/css"
+ href="$$root/css/syntax.css" />
</head>
<body>
<h1>MyAweSomeCompany - $title</h1>
<div id="navigation">
<a href="$$root/index.html">Home</a>
<a href="$$root/about.html">About</a>
- <a href="$$root/products.html">Products</a>
+ <a href="$$root/code.html">Code</a>
</div>
$body
@@ -135,7 +137,7 @@ import Text.Hakyll.Render (renderChain)
import Text.Hakyll.Renderables (createPagePath)
main = hakyll $ do
renderChain ["templates/default.html"]
- (createPagePath "about.markdown")
+ (createPagePath "index.markdown")
~~~~~
Or, to render all our three pages:
@@ -145,19 +147,20 @@ import Text.Hakyll (hakyll)
import Text.Hakyll.Render (renderChain)
import Text.Hakyll.Renderables (createPagePath)
main = hakyll $ do
- render "about.markdown"
+ render "about.rst"
render "index.markdown"
- render "products.markdown"
+ render "code.lhs"
where render = renderChain ["templates/default.html"]
. createPagePath
~~~~~
-This will create the following files:
+As you can see, we can render a variety of formats. This will create the
+following files:
~~~~~
_site/about.html
_site/index.html
-_site/products.html
+_site/code.html
~~~~~
## CSS, images and other static files