mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-14 05:32:51 -06:00
fine-tuning api documentation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user