2module ExtractNoscript (extract) where
6extract (Module _ _ _ stmts) =
7 concatMap (\s -> "<p>" ++ s ++ "</p>") (concatMap stmtExtract stmts)
8 where stmtExtract (Def _ _ e) = extract' e
15 Binop op e1 e2 -> case (op, f e1, f e2) of
16 ("++", [s1], [s2]) -> [s1 ++ s2]
17 (_ , ss1 , ss2 ) -> ss1 ++ ss2
19 App (App (Var "link") src) txt ->
20 case (f src, f txt) of
21 ([s1],[s2]) -> [ "<a href=\"" ++ s1 ++ "\">" ++ s2 ++ "</a>" ]
22 ( ss1, ss2) -> ss1 ++ ss2
23 App (Var "header") e -> tag "h1" e
24 App (Var "bold") e -> tag "b" e
25 App (Var "italic") e -> tag "i" e
26 App (Var "monospace") e -> tag "code" e
27 App e1 e2 -> f e1 ++ f e2
28 If eb et ef -> f et ++ f ef
29 Let defs e -> concatMap (\(Definition _ _ d) -> f d) defs ++ f e
31 Case e cases -> concatMap (f . snd) cases
32 Data _ es -> concatMap f es
35tag t e = map (\s -> concat [ "<", t, ">", s, "</", t, ">" ]) (extract' e)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list