-
Notifications
You must be signed in to change notification settings - Fork 35
/
AddLinks.lhs
24 lines (19 loc) · 901 Bytes
/
AddLinks.lhs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Little hack to add links to the navigation bars when generating the
html website.
> main :: IO ()
> main = interact addLinks
> addLinks :: String -> String
> addLinks [] = error "not found"
> addLinks ('<':'/':'u':'l':'>':'\n':'<':'/':'d':'i':'v':'>':xs) =
> "</ul>" ++ linkSection ++ "\n</div>" ++ xs
> addLinks (x:xs) = x : addLinks xs
> linkSection :: String
> linkSection =
> "<hr />\n\
> \<ul class=\"sectlevel1\">\n\
> \<li><a href=\"http://jakewheat.github.io/intro_to_parsing\" class=\"bare\">Homepage</a></li>\n\
> \<li><a href=\"https://github.com/JakeWheat/intro_to_parsing\" class=\"bare\">Repository</a></li>\n\
> \<li><a href=\"https://github.com/JakeWheat/intro_to_parsing/issues\" class=\"bare\">Bug tracker</a></li>\n\
> \<li><a href=\"http://jakewheat.github.io/\" class=\"bare\">Parent project</a>\n\
> \</li><li>[email protected]</li>\n\
> \</ul>\n"