1
0
forked from GitHub/gf-core

fine-tuning api documentation

This commit is contained in:
aarne
2007-06-08 13:42:09 +00:00
parent 2f29d1e33a
commit 8328624ea0
2 changed files with 10 additions and 4 deletions

View File

@@ -7,7 +7,11 @@ gfs:
runghc mkgfs.hs
exx:
gf ExxSwe.gf ExxGer.gf ExxFre.gf ExxFin.gf ExxEng.gf <exx.gfs
gf exxs.gfcm <exx.gfs
gfcm:
echo "pm | wf exxs.gfcm" | gf ExxSwe.gf ExxGer.gf ExxFin.gf ExxEng.gf
#ExxFre takes too long
html:
cp ../Constructors.gf .

View File

@@ -1,3 +1,5 @@
import Char (isDigit)
src = "Constructors.html"
tgt = "Cons.html"
linkfile ex = "links/" ++ ex ++ ".txt"
@@ -8,13 +10,13 @@ main = do
readFile src >>= (mapM_ mkLink . lines)
mkLink line = case break (=="--") (words (takeWhile (/='#')line)) of
(fun : ":" : typ, _ : num : ex) ->
(fun : ":" : typ, _ : num : ex) | isDigit (head num) ->
appendFile tgt ("\n" ++ takeInit line ++ " " ++ link ex typ num)
_ -> appendFile tgt ("\n" ++ line)
where
takeInit line = init (init (takeWhile (/='.') line))
link ex typ num =
"<a href=\"" ++ linkfile (example typ num) ++ "\">" ++ unwords ex ++ "</a>"
link ex typ num =
"<a href=\"" ++ linkfile (example typ num) ++ "\">" ++ unwords ex ++ "</a>"
example typ num = case reverse typ of
";":val:_ -> "ex" ++ init num ++ "_" ++ val
val:_ -> "ex" ++ init num ++ "_" ++ val