on master help sign in
Added some different formats in the first example as a demonstration.
commit81e3df1e11481f20294fcc8bc96418e40402c6ba authorJasper Van der Jeugt <jaspervdj@gmail.com> dateSun 24 Jan 2010, 19:38 (17 years ago) parentfe7182d
7 files changed+56−18
examples/brochure/about.markdown → examples/brochure/about.rst+4−1 examples/brochure/products.markdown → examples/brochure/code.lhs+10−2 examples/brochure/css/syntax.css+20 examples/brochure/hakyll.hs+2−2 examples/brochure/index.markdown+5−2 examples/brochure/templates/default.html+2−1 examples/hakyll/tutorial1.markdown+13−10
examples/brochure/about.markdown → examples/brochure/about.rstrenamed+4−1
@@ -5,7 +5,10 @@ Nullam imperdiet sodales orci vitae molestie. Nunc quam orci, pharetra a
55rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
66Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
77habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
8−accumsan vitae. 碁
8+accumsan vitae.
9+
10+1. Amamus Unicode 碁
11+2. Interdum nex magna.
912
1013Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
1114risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
examples/brochure/products.markdown → examples/brochure/code.lhsrenamed+10−2
@@ -1,13 +1,21 @@
11---
2−title: Products
2+title: Code
33---
44Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
55lectus mi egestas nulla, pulvinar lobortis nunc eros id nisl. Curabitur
6−imperdiet, erat at accumsan vulputate, purus nunc blandit nulla, dictum
6+imperdiet, erat at accumsan vulputate.
7+
8+> reverse' [] = []
9+> reverse' (x:xs) = (reverse' xs) ++ [x]
10+
11+Purus nunc blandit nulla, dictum.
12+
713vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
814justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
915ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
1016
17+> main = print $ reverse' [1 .. 10]
18+
1119Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
1220vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
1321fringilla tempor ut a nunc. Pellentesque elementum elit lorem.
examples/brochure/css/syntax.cssnew file+20
@@ -0,0 +1,20 @@
1+/* Generated by pandoc. */
2+table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre
3+{ margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; }
4+td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; }
5+td.sourceCode { padding-left: 5px; }
6+pre.sourceCode { }
7+pre.sourceCode span.Normal { }
8+pre.sourceCode span.Keyword { color: #007020; font-weight: bold; }
9+pre.sourceCode span.DataType { color: #902000; }
10+pre.sourceCode span.DecVal { color: #40a070; }
11+pre.sourceCode span.BaseN { color: #40a070; }
12+pre.sourceCode span.Float { color: #40a070; }
13+pre.sourceCode span.Char { color: #4070a0; }
14+pre.sourceCode span.String { color: #4070a0; }
15+pre.sourceCode span.Comment { color: #60a0b0; font-style: italic; }
16+pre.sourceCode span.Others { color: #007020; }
17+pre.sourceCode span.Alert { color: red; font-weight: bold; }
18+pre.sourceCode span.Function { color: #06287e; }
19+pre.sourceCode span.RegionMarker { }
20+pre.sourceCode span.Error { color: red; font-weight: bold; }
examples/brochure/hakyll.hs+2−2
@@ -5,7 +5,7 @@ import Text.Hakyll.Renderables (createPagePath)
55
66main = hakyll $ do
77 directory css "css"
8− render "about.markdown"
8+ render "about.rst"
99 render "index.markdown"
10− render "products.markdown"
10+ render "code.lhs"
1111 where render = renderChain ["templates/default.html"] . createPagePath
examples/brochure/index.markdown+5−2
@@ -5,8 +5,11 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce tempor, urna et
55auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
66amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
77
8−Mauris sit amet justo mi. Curabitur vel quam felis. In hac habitasse platea
9−dictumst. Etiam nec consequat risus. Donec consequat est vitae neque fermentum
8+- Mauris sit amet justo mi.
9+- Curabitur vel quam felis.
10+- In hac habitasse platea dictumst.
11+
12+Etiam nec consequat risus. Donec consequat est vitae neque fermentum
1013feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
1114tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
1215non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
examples/brochure/templates/default.html+2−1
@@ -6,13 +6,14 @@
66 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
77 <title>MyAweSomeCompany - $title</title>
88 <link rel="stylesheet" type="text/css" href="$root/css/default.css" />
9+ <link rel="stylesheet" type="text/css" href="$root/css/syntax.css" />
910 </head>
1011 <body>
1112 <h1>MyAweSomeCompany - $title</h1>
1213 <div id="navigation">
1314 <a href="$root/index.html">Home</a>
1415 <a href="$root/about.html">About</a>
15− <a href="$root/products.html">Products</a>
16+ <a href="$root/code.html">Code</a>
1617 </div>
1718
1819 $body
examples/hakyll/tutorial1.markdown+13−10
@@ -61,10 +61,10 @@ it will generate a very nice main function.
6161## Pages
6262
6363An important concept in Hakyll is Pages. Pages are text files that can be
64−written in markdown, html or TeX. Furthermore, they can also contain some
65−metadata. The metadata is placed in the file header and surrouded by `---`
66−lines. Each line should contain a `key: value` pair. Let's have a look at the
67−`about.markdown` page.
64+written in markdown, html, rst... basically anything Pandoc supports.
65+Furthermore, they can also contain some metadata. The metadata is placed in the
66+file header and surrouded by `---` lines. Each line should contain a
67+`key: value` pair. Let's have a look at the `index.markdown` page.
6868
6969 ---
7070 title: About
@@ -91,13 +91,15 @@ html files) containing a number of keys. The syntax for these keys is
9191 <title>MyAweSomeCompany - $title</title>
9292 <link rel="stylesheet" type="text/css"
9393 href="$$root/css/default.css" />
94+ <link rel="stylesheet" type="text/css"
95+ href="$$root/css/syntax.css" />
9496 </head>
9597 <body>
9698 <h1>MyAweSomeCompany - $title</h1>
9799 <div id="navigation">
98100 <a href="$$root/index.html">Home</a>
99101 <a href="$$root/about.html">About</a>
100− <a href="$$root/products.html">Products</a>
102+ <a href="$$root/code.html">Code</a>
101103 </div>
102104
103105 $body
@@ -135,7 +137,7 @@ import Text.Hakyll.Render (renderChain)
135137import Text.Hakyll.Renderables (createPagePath)
136138main = hakyll $ do
137139 renderChain ["templates/default.html"]
138− (createPagePath "about.markdown")
140+ (createPagePath "index.markdown")
139141~~~~~
140142
141143Or, to render all our three pages:
@@ -145,19 +147,20 @@ import Text.Hakyll (hakyll)
145147import Text.Hakyll.Render (renderChain)
146148import Text.Hakyll.Renderables (createPagePath)
147149main = hakyll $ do
148− render "about.markdown"
150+ render "about.rst"
149151 render "index.markdown"
150− render "products.markdown"
152+ render "code.lhs"
151153 where render = renderChain ["templates/default.html"]
152154 . createPagePath
153155~~~~~
154156
155−This will create the following files:
157+As you can see, we can render a variety of formats. This will create the
158+following files:
156159
157160~~~~~
158161_site/about.html
159162_site/index.html
160−_site/products.html
163+_site/code.html
161164~~~~~
162165
163166## CSS, images and other static files