on master help sign in
Added some different formats in the first example as a demonstration.
81e3df1Jasper Van der Jeugt
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
5rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
5rhoncus vitae, eleifend id felis. Suspendisse potenti. Etiam vitae urna orci.
6Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
6Quisque pellentesque dignissim felis, egestas tempus urna luctus vitae. In hac
7habitasse platea dictumst. Morbi fringilla mattis odio, et mattis tellus
7habitasse 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.
9
12
10Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
13Vivamus eget mauris sit amet nulla laoreet lobortis. Nulla in diam elementum
11risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
14risus convallis commodo. Cras vehicula varius dui vitae facilisis. Proin
examples/brochure/products.markdown → examples/brochure/code.lhsrenamed+10−2
@@ -1,13 +1,21 @@
1---
1---
2−title: Products
2+title: Code
3---
3---
4Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
4Etiam condimentum auctor semper. Donec lobortis, magna id sodales sollicitudin,
5lectus mi egestas nulla, pulvinar lobortis nunc eros id nisl. Curabitur
5lectus 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+
7vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
13vestibulum sem lorem eget ipsum. Nunc tincidunt, turpis ut fermentum dapibus,
8justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
14justo tortor bibendum sem, at facilisis justo odio luctus lectus. Quisque nec
9ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
15ligula ipsum. Nunc augue lacus, ullamcorper vel dapibus in, mattis eget elit.
10
16
17+> main = print $ reverse' [1 .. 10]
18+
11Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
19Integer ut dui eu felis mollis vestibulum. Etiam at nibh id diam aliquet
12vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
20vestibulum sit amet a nibh. Aliquam erat volutpat. Etiam vitae nulla at dolor
13fringilla tempor ut a nunc. Pellentesque elementum elit lorem.
21fringilla 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)
5
5
6main = hakyll $ do
6main = hakyll $ do
7 directory css "css"
7 directory css "css"
8− render "about.markdown"
8+ render "about.rst"
9 render "index.markdown"
9 render "index.markdown"
10− render "products.markdown"
10+ render "code.lhs"
11 where render = renderChain ["templates/default.html"] . createPagePath
11 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
5auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
5auctor tincidunt, eros mauris facilisis purus, eget sollicitudin leo massa sit
6amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
6amet ipsum. Vivamus eu massa in urna vehicula rutrum eget sit amet purus.
7
7
8+- Mauris sit amet justo mi.
8−Mauris sit amet justo mi. Curabitur vel quam felis. In hac habitasse platea
9+- Curabitur vel quam felis.
10+- In hac habitasse platea dictumst.
11+
9−dictumst. Etiam nec consequat risus. Donec consequat est vitae neque fermentum
12+Etiam nec consequat risus. Donec consequat est vitae neque fermentum
10feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
13feugiat nec ac nibh. Nulla rhoncus, odio quis scelerisque rutrum, metus sem
11tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
14tempor ante, a ornare ipsum felis sed ligula. Morbi urna lectus, scelerisque
12non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
15non pharetra in, rutrum quis ligula. Phasellus semper ullamcorper arcu eu
examples/brochure/templates/default.html+2−1
@@ -6,13 +6,14 @@
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7 <title>MyAweSomeCompany - $title</title>
7 <title>MyAweSomeCompany - $title</title>
8 <link rel="stylesheet" type="text/css" href="$root/css/default.css" />
8 <link rel="stylesheet" type="text/css" href="$root/css/default.css" />
9+ <link rel="stylesheet" type="text/css" href="$root/css/syntax.css" />
9 </head>
10 </head>
10 <body>
11 <body>
11 <h1>MyAweSomeCompany - $title</h1>
12 <h1>MyAweSomeCompany - $title</h1>
12 <div id="navigation">
13 <div id="navigation">
13 <a href="$root/index.html">Home</a>
14 <a href="$root/index.html">Home</a>
14 <a href="$root/about.html">About</a>
15 <a href="$root/about.html">About</a>
15− <a href="$root/products.html">Products</a>
16+ <a href="$root/code.html">Code</a>
16 </div>
17 </div>
17
18
18 $body
19 $body
examples/hakyll/tutorial1.markdown+13−10
@@ -61,10 +61,10 @@ it will generate a very nice main function.
61## Pages
61## Pages
62
62
63An important concept in Hakyll is Pages. Pages are text files that can be
63An important concept in Hakyll is Pages. Pages are text files that can be
64+written in markdown, html, rst... basically anything Pandoc supports.
64−written in markdown, html or TeX. Furthermore, they can also contain some
65+Furthermore, they can also contain some metadata. The metadata is placed in the
65−metadata. The metadata is placed in the file header and surrouded by `---`
66+file header and surrouded by `---` lines. Each line should contain a
66−lines. Each line should contain a `key: value` pair. Let's have a look at the
67+`key: value` pair. Let's have a look at the `index.markdown` page.
67−`about.markdown` page.
68
68
69 ---
69 ---
70 title: About
70 title: About
@@ -91,13 +91,15 @@ html files) containing a number of keys. The syntax for these keys is
91 <title>MyAweSomeCompany - $title</title>
91 <title>MyAweSomeCompany - $title</title>
92 <link rel="stylesheet" type="text/css"
92 <link rel="stylesheet" type="text/css"
93 href="$$root/css/default.css" />
93 href="$$root/css/default.css" />
94+ <link rel="stylesheet" type="text/css"
95+ href="$$root/css/syntax.css" />
94 </head>
96 </head>
95 <body>
97 <body>
96 <h1>MyAweSomeCompany - $title</h1>
98 <h1>MyAweSomeCompany - $title</h1>
97 <div id="navigation">
99 <div id="navigation">
98 <a href="$$root/index.html">Home</a>
100 <a href="$$root/index.html">Home</a>
99 <a href="$$root/about.html">About</a>
101 <a href="$$root/about.html">About</a>
100− <a href="$$root/products.html">Products</a>
102+ <a href="$$root/code.html">Code</a>
101 </div>
103 </div>
102
104
103 $body
105 $body
@@ -135,7 +137,7 @@ import Text.Hakyll.Render (renderChain)
135import Text.Hakyll.Renderables (createPagePath)
137import Text.Hakyll.Renderables (createPagePath)
136main = hakyll $ do
138main = hakyll $ do
137 renderChain ["templates/default.html"]
139 renderChain ["templates/default.html"]
138− (createPagePath "about.markdown")
140+ (createPagePath "index.markdown")
139~~~~~
141~~~~~
140
142
141Or, to render all our three pages:
143Or, to render all our three pages:
@@ -145,19 +147,20 @@ import Text.Hakyll (hakyll)
145import Text.Hakyll.Render (renderChain)
147import Text.Hakyll.Render (renderChain)
146import Text.Hakyll.Renderables (createPagePath)
148import Text.Hakyll.Renderables (createPagePath)
147main = hakyll $ do
149main = hakyll $ do
148− render "about.markdown"
150+ render "about.rst"
149 render "index.markdown"
151 render "index.markdown"
150− render "products.markdown"
152+ render "code.lhs"
151 where render = renderChain ["templates/default.html"]
153 where render = renderChain ["templates/default.html"]
152 . createPagePath
154 . createPagePath
153~~~~~
155~~~~~
154
156
157+As you can see, we can render a variety of formats. This will create the
155−This will create the following files:
158+following files:
156
159
157~~~~~
160~~~~~
158_site/about.html
161_site/about.html
159_site/index.html
162_site/index.html
160−_site/products.html
163+_site/code.html
161~~~~~
164~~~~~
162
165
163## CSS, images and other static files
166## CSS, images and other static files